You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paul Spencer <pa...@apache.org> on 2008/06/11 16:03:06 UTC
Are classifiers the answer, are they mature, what are the pitfalls?
The Shale project has a need to produce a few artifacts for a project
that differ only in dependencies [1]. Specifically one jar for JDK 1.4
and one jar for JDK 1.5. It appear that classifiers can be used in the
generation artifacts for different variation of a project[2].
1) Is their a better way to meet the requirements?
2) Are classifiers stable in a multi-project build?
3) Are classifiers well supported by Maven's plugins?
4) What is the minimum Maven version that should be used when creating
artifacts with classifiers?
5) What is the minimum Maven version that should be used when depending
on an artifact containing a classifier?
5) For projects dependent on an artifact with classifiers, can the
artifact be calculated by Maven?
Asked another way: Assuming the shale-test v1.1.0 artifacts
shale-test-1.1.0-jdk14.jar and shale-test-1.1.0-jdk15.jar are in the
repository, is the classifier jdk14 or jdk15 required in the shale-test
dependency configuration of a project using shale-test v1.1.0 or will
maven used the current jdk environment to select the correct shale-test
artifact?
6) What are the pitfalls or disadvantages?
Paul Spencer
[1] http://markmail.org/message/ivziozp3lzrxbpri
[2] http://maven.apache.org/plugins/maven-jar-plugin/usage.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Are classifiers the answer, are they mature, what are the pitfalls?
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
>1) Is their a better way to meet the requirements?
This is a very common use of classifiers. It's probably the best way to
handle what you want.
>2) Are classifiers stable in a multi-project build?
Yes.
>3) Are classifiers well supported by Maven's plugins?
Yes.
>4) What is the minimum Maven version that should be used when creating
>artifacts with classifiers?
2.0, been there since "day one"
>5) What is the minimum Maven version that should be used when depending
>on an artifact containing a classifier?
Same as above.
>5) For projects dependent on an artifact with classifiers, can the
>artifact be calculated by Maven?
No, unless you are using a property as mentioned elsewhere in the
thread.
>6) What are the pitfalls or disadvantages?
The only thing to note is that the main artifact can't have a
classifier...so you should pick one (ie jdk5) to be the normal
non-classifier artifact and have jdk14 be the "attached" classifier.
This all assumes you can easily create both artifacts during the same
build (retrotranslating and attaching is possible to do, there are
examples in the Nexus-Indexer and also Maven-Artifact 3.0)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Are classifiers the answer, are they mature, what are the pitfalls?
Posted by EJ Ciramella <ej...@upromise.com>.
We've been using classifiers for quite some time now (some like in your
case, we made up).
We haven't had any problems (we're using 2.0.5), but I think you could
either determine the jdk involved and pull said version from the repo.
There was a link shared a while back showing all the different variables
that are available to maven:
http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide
Maybe use ${java.vm.version}?
Knowing that value, why not use that (each version) as the classifier
name. Then I think you could programmatically look up the version in
the repo you'd like...
-----Original Message-----
From: Paul Spencer [mailto:paulsp@apache.org]
Sent: Wednesday, June 11, 2008 10:03 AM
To: users@maven.apache.org
Subject: Are classifiers the answer, are they mature, what are the
pitfalls?
The Shale project has a need to produce a few artifacts for a project
that differ only in dependencies [1]. Specifically one jar for JDK 1.4
and one jar for JDK 1.5. It appear that classifiers can be used in the
generation artifacts for different variation of a project[2].
1) Is their a better way to meet the requirements?
2) Are classifiers stable in a multi-project build?
3) Are classifiers well supported by Maven's plugins?
4) What is the minimum Maven version that should be used when creating
artifacts with classifiers?
5) What is the minimum Maven version that should be used when depending
on an artifact containing a classifier?
5) For projects dependent on an artifact with classifiers, can the
artifact be calculated by Maven?
Asked another way: Assuming the shale-test v1.1.0 artifacts
shale-test-1.1.0-jdk14.jar and shale-test-1.1.0-jdk15.jar are in the
repository, is the classifier jdk14 or jdk15 required in the shale-test
dependency configuration of a project using shale-test v1.1.0 or will
maven used the current jdk environment to select the correct shale-test
artifact?
6) What are the pitfalls or disadvantages?
Paul Spencer
[1] http://markmail.org/message/ivziozp3lzrxbpri
[2] http://maven.apache.org/plugins/maven-jar-plugin/usage.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org