Here is our scenario:

We have our SCM trunk and a "release candidate" branch. We merge code into the 
"RC" branch when we want it to go into the next release.

In the past everyone built against the RC branch artifacts. However, now we 
have two release cycles going at the same time and some people want to build 
against the RC branch and others want to build against the trunk. We also need 
to setup servers, etc with the proper artifacts.

So, I think I need to produce two artifacts for each project: 
"project-version.jar" and "project-version-trunk.jar". This, I think is simple, 
I just set the <finalName> in the trunk profile.

Now, how do I use these so that a user building under the "trunk" profile will 
only use artifacts with the new classifier?

We have a parent POM, used everywhere, that defines all of our dependency 
management to insure everyone stays "on version" for all of our dependencies. 
Could I create a property in the "trunk" profile and then use that in our 
dependency  management? For example:

<profile>
                <id>trunk</id>
                <build>
                                
<finalname>${project.artifactId}-${project.version}-head<finalName>
                </build>
                <properties>
                                <our.classifier>head</our.classifier> <-- 
property to use in dependencies
                </properties>
                ...
</profile>

<dependencyManagement>
                <dependencies>
                                <dependency>
                                                <groupId>com.ours</groupId>
                                                
<artifactId>project1</artifactId>
                                                
<version>${project.version}</version>
                                                
<classifier>${our.classifier}</classifier> <-- use of the property (if the 
property DNE, or is blank, is that OK?
                                </dependency>
                                ...
                </dependencies>
</dependencyManagement>



This is just me using my limited understanding trying to figure out the 
solution - if there is a more appropriate way to do this please let me know


Thanks
scott

Reply via email to