[
http://jira.codehaus.org/browse/MOJO-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=218362#action_218362
]
Ingo Fischer commented on MOJO-1523:
------------------------------------
As far as i see "BaseBuild" and "Filters" aren't the way to go, as they can
only filter additional resource files.
But i want to filter my pom.xml.
I tried filtering, the result is the same as before - properties are not
evaluated.
This pom.xml (pom.properties stays the same):
--------------------------------------------
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<build>
<filters>
<filter>${basedir}/pom.properties</filter>
</filters>
<defaultGoal>test</defaultGoal>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Results in:
-----------
"""
Missing:
----------
1) junit:junit:jar:${junit.version}
"""
again.
My goal ist to remove ALL Properties (version numbers, path's) from my pom.xml
into a properties-file, as this would be easier to manage and nicer to read.
> 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