tags:

views:

49

answers:

2

Is there a way to make maven build 1.5 and 1.6 bytecode jars simultaneously. I know I can use classifiers to name them, but this forces to me to build them separately. I would ultimately like to do the following:

mvn clean install

And in my target directory see something like:

fooSource.jar
foo-1.6.jar
foo-1.5.jar
+1  A: 

You can try using sub-projects (modules) with different compiler configurations.

But except for installing the repository, this wouldn't be useful. Instead you can use maven profiles in order to generate different artifacts in different cases.

Bozho
I currently am using profiles, but I still have to build each one separately. In other words I have to activate one profile, then the other. If they are simultaneously active they stomp over each other.
grieve
Also consider how other people will be able to pick these up from a maven repository. As you've done things, they won't be easily distinguishable.
Dominic Mitchell
+1  A: 

Is there a way to make maven build 1.5 and 1.6 bytecode jars simultaneously?

No, you'll have to run two clean builds. I'd use profiles and a CI engine supporting build matrix for this (Hudson does).

Pascal Thivent
+1 for keeping things separate and (if I could) +1 for hudson. Maven's build transparency could be kindly described as "murky" - forcing together what should be separate will only muddy the waters still futher.
mdma