With a new build environment comes changes to your existing build. When you moved to Ant, you made these properties files. Now it might be time to change again if you move to Maven. So just realize upfront that you will probably have to change.
The easiest way to achieve your requirements is through the use of profiles either in pom.xml, settings.xml, or profiles.xml file. Then you call "mvn -P name1 package" and it uses the variable values you have defined in the "name1" profile. See this page for more info: http://maven.apache.org/guides/introduction/introduction-to-profiles.html If you want to keep your existing properties files and build process, stay in Ant. You could probably write some complicated plugin to duplicate what you already have in ANT, but I wouldn't do it. Wayne On 3/14/06, Sergei Dubov <[EMAIL PROTECTED]> wrote: > I am still trying to get my head around the concept of user profiles > (using Maven2). Here is what I do in Ant: > > 1. Let's say we have a project called "leonardo". > > 2. To work with my Ant process the user is required to have a directory > called $HOME/.leonardorc and an environment variable called > $LEONARDO_EXT that contains his current configurational profile. > > 3. $HOME/.leonardorc contains customer properties files. Let's say: > db.properties.${LEONARDO_EXT}, c3p0.properties.${LEONARDO_EXT}, > tomcat.properties.${LEONARDO_EXT}. They all contain configurational info > specific to that user's current profile (set by LEONARD_EXT). > > 4. The moment a user tries to do something (build, deploy, whatever). > Some of those files will be copied to the "right" place in the project > repository, and some will be directly referenced in the Ant build > script. Of course, the extension of ${LEONARDO_EXT} will be removed upon > copy. > > I'd really appreciate if somebody could explain to me how to achieve the > same flexibility with Maven. Note: the above-mentioned property files > have to be the entities that specify the user configuration. > > Thanks a lot beforehand! > > Serge > > >
