Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
2.0.4
-
None
-
None
-
Maven 2
Description
It should be possible to qualify different flavors of an artifact with a list of properties instead of just a single classifier.
The qualified artifacts could be named:
myproj-1.0-env=prod-distributed=true.ear myproj-1.0-env=dev-distributed=true.ear myproj-1.0-env=prod-distributed=false.ear myproj-1.0-env=dev-distributed=false.ear
They would be referenced that way:
<dependency> <groupId>com.foo.bar</groupId> <artifactId>myproj</artifactId> <version>1.0</version> <qualifiers> <qualifier><name>env</name><value>prod</value></qualifier> <qualifier><name>distributed</name><value>true</value></qualifier> </qualifiers> </dependency>
And the order of the classifiers should not be important. The previous should resolve both:
myproj-1.0-env=prod-distributed=true.ear myproj-1.0-distributed=true-env=prod.ear
Qualifiers could also be transitive. A typical use case is EARs (or any other types of artifacts which when packaged embed other artifacts) . If you want to build the distributed production version of an EAR, then you certainly want to include in that EAR the distributed production versions of its WAR dependencies.
To avoid clash in naming with current classifiers, maybe this functionality could be named qualifiers. Finally, semantically speaking, the difference between classifiers and "qualifiers" could be that the "qualifiers" could be used for mutually exclusive artifacts whereas classified versions of a given artifact can be used either together or not.
To illustrate my point, regarding qualifiers, there is no sens in depending on both prod and dev versions of a WAR or depending on both the distributed and non distributed versions of a same EAR, whereas regarding classifiers, in code generation scenarios, daos and entities are generated by a single project and attached as seperate jars, they are a whole but it's up to you to depend only on entities or on both entities and DAOs. For a more detailed explanation of that code generation use case, please see the discussion with Stephane Nicoll in MEAR-44.
Regards,
Cédric Vidal