I have a property file with the following
junit.version=3.8.1
dbcp.version=5.5.27
oracle.jdbc.version=10.2.0.2.0
I try to read those proper
u can define like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<id>pre-clean-config</id>
<phase>pre-clean</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>config.properties</file>
</files>
</configuration>
</execution>
<execution>
<id>initialize-config</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>config.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
The initialize
phase is not part of the clean lifecycle. You need to also bind your properties plugin to pre-clean
phase.
However, the dependency resolution runs before resolving and executing other plugins, so your approach won't work.
The proper way to deal with that would be to move dependency versions into a parent pom.xml and use the same parent pom in both of your projects.