|
Yes, this could be part of the build helper plugin since this is a very common task in the build process. There are two main use cases for this plugin (maybe more for others): 1. Ability to define Maven properties in a property fileSo instead of this: <properties> <webmaster.name>The Dude</webmaster.name> <webmaster.email>dude@dude.com</webmaster.email> </properties> we can define them in a property file webmaster.name=The Dude webmaster.email=dude@dude.com This will allow developers to easily load different properties based on different environments. Many applications have varying configuration properties for different environments and this would help maintain them in seperate files rather than having everything in a pom and using profiles which many find overkill for such circumstances. 2. Writing ALL Maven properties to a fileMaven properties which were created in pom.xml or loaded via #1 could be written to a file. This comes handy when these properties need to be available at runtime. The best example I can think of is the property files needed to initialize Spring's PropertyPlaceholderConfigurer. Any decision on this plugin? It will be useful to many people here. If it's made part of the build-helper plugin, that would work fine too. Modification for reading properties which includes expansion of ${} tokens against project properties, system properties and environment variables. E.g., if a .properties file contains: war.dir=${env.HOME}/${env.OS}
and the environment variables HOME and OS have values ABC and Windows_NT when the property is available to maven, this will be expanded to: war.dir=ABC/Windows_NT
Corporate Gadfly made changes - 20/Nov/06 01:36 PM
This is a fabulous idea and a huge help when you are faced with using the Tom Nelson Any chance this plugin could be enhanced to allow overriding of properties in dependent poms? An updated version of this plugin can be downloaded from here: http://arsenalist.com/2007/02/07/maven-properties-plugin-download/ It has the additional feature of the properties being defined being able to use other properties. This plugin gets downloaded a bunch of times everyday and I really don't see why this hasn't been accepted yet. I apologize, given the amount of votes if you want we can give you access to the sandbox added Zarar to the project This is now in SVN: https://svn.codehaus.org/mojo/trunk/mojo/properties-maven-plugin/ Thanks to everyone for voting. Thanks again Carlos.
Zarar Siddiqi made changes - 06/Jun/07 03:47 PM
moved to the sandbox until released https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/properties-maven-plugin/ I need some help here: http://www.nabble.com/-Vote--properties-maven-plugin-release-tf4094624.html FYI, the sandbox URL has moved to https://svn.codehaus.org/mojo/trunk/sandbox/properties-maven-plugin/ BTW, I'm still keen to see this plugin released. To write all project properties to file is not always desirable. The attached patch adds class (goal) WriteProperties which writes properties of your choice to outputFile. It would be nice if you committed this patch and I would also like to see this plugin be released in some way. Usage: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <executions> <execution> <phase>generate-resources</phase> <goals> <goal>write-properties</goal> </goals> <configuration> <addBuildDate>true</addBuildDate> <properties> <property> <name>project.version</name> <value>${project.version}</value> </property> <property> <name>project.name</name> <value>${project.name}</value> </property> </properties> <outputFile> target/classes/app.properties </outputFile> </configuration> </execution> </execusions> </plugin>
Tony Dalbrekt made changes - 26/Apr/08 12:36 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I would still like to understand what this plugin is supposed to do. Sounds to me like it might be something that might fit in the resources or build helper plugins.