Yes, it is a valid use case.

My company does something kind of similar, but it's used for including two
versions of the same artifact in the build (and in the ear/war) - for
example, if we have a "2.1" and a "3.0" release of a project, and based on
legacy reasons and transitive dependencies, we have to include both those
jars in the build (which is safe because of package names not clashing).
What we've done is used a  classifier of "2.1" which allows maven to pick up
both versions and not try and resolve the best one to include.  We do have
to push the artifacts out to the repository with both the unclassified and
the classified artifacts, since not everyone needs to use the classifier.

On Thu, Oct 29, 2009 at 9:01 AM, Jim Sellers <[email protected]> wrote:

> Hi all.
>
> I'm trying to fix MECLIPSE-615  [1].  The fix that seems fastest to me
> might
> cause an issue if you include multiple dependencies from the same module,
> using the same scope.
>
> I don't know if this use case makes any sense since I've only used
> classifiers for test-jar's.  Does anyone use something (roughly) along the
> lines of:
>
>    <dependency>
>      <groupId>com.example</groupId>
>      <artifactId>myArtifact</artifactId>
>      <version>1.2.3</version>
>      <classifier>*bin*</classifier>
>      <scope>compile</scope>
>    </dependency>
>    <dependency>
>      <groupId>com.example</groupId>
>      <artifactId>myArtifact</artifactId>
>      <version>1.2.3</version>
>      <classifier>*dev*</classifier>
>      <scope>compile</scope>
>    </dependency>
>    <dependency>
>      <groupId>com.example</groupId>
>      <artifactId>myArtifact</artifactId>
>      <version>1.2.3</version>
>      <classifier>*prod*</classifier>
>      <scope>compile</scope>
>    </dependency>
>
>
> Same groupId, artifactId, version, and scope, just with different
> classifiers?  Is this a valid use case of maven?
>
> Thanks for your time!
> Jim
>
> [1] http://jira.codehaus.org/browse/MECLIPSE-615
>

Reply via email to