Why not use the mechanism which Maven already provides? http://maven.apache.org/pom.html#BaseBuild_Element
build / filters / filter - Robert > Date: Tue, 20 Apr 2010 10:21:13 -0500 > From: [email protected] > To: [email protected] > Subject: [mojo-dev] [jira] Created: (MOJO-1523) External properties from file > don't get evaluated in pom.xml > > External properties from file don't get evaluated in pom.xml > ------------------------------------------------------------ > > Key: MOJO-1523 > URL: http://jira.codehaus.org/browse/MOJO-1523 > Project: Mojo > Issue Type: Bug > Components: properties > Reporter: Ingo Fischer > Priority: Critical > Attachments: PropertiesTest.zip > > I want to externalize properties from my pom.xml into a file named > pom.properties. > I configured the properties plugin to read the file in the initialize-phase. > However, the properties in my pom.xml don't get replaced with the one from > the prop-file, as the output in my example shows: > > Example pom.xml: > ---------------- > <project> > <modelVersion>4.0.0</modelVersion> > <groupId>com.mycompany.app</groupId> > <artifactId>my-app</artifactId> > <version>1</version> > > <build> > <plugins> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>properties-maven-plugin</artifactId> > <version>1.0-alpha-2</version> > <configuration> > <files> > <file>${basedir}/pom.properties</file> > </files> > </configuration> > <executions> > <execution> > <phase>initialize</phase> > <goals> > <goal>read-project-properties</goal> > </goals> > <configuration> > <files> > <file>${basedir}/pom.properties</file> > </files> > </configuration> > </execution> > </executions> > </plugin> > </plugins> > </build> > > <dependencies> > <dependency> > <groupId>junit</groupId> > <artifactId>junit</artifactId> > <version>${junit.version}</version> > <scope>test</scope> > </dependency> > </dependencies> > </project> > > > pom.properties: > -------------- > junit.version=1 > > > Output: > ------- > (...) > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to resolve artifact. > > Missing: > ---------- > 1) junit:junit:jar:${junit.version} > (...) > > I don't know if it's a bug or i'm doing something wrong. > I also asked at Stackoverflow where someone said i should file an issue. > Corresponding Thread: > http://stackoverflow.com/questions/2664362/properties-maven-plugin-error-loading-properties-file > > -- > This message is automatically generated by JIRA. > - > If you think it was sent incorrectly contact one of the administrators: > http://jira.codehaus.org/secure/Administrators.jspa > - > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop
