You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Carlos Alonso <ca...@unkasoft.com> on 2008/11/18 18:24:09 UTC

Problem resolving dependencies with classifier

Hi all.

I'm having an annoying problem with dependencies using classifier. The
situation is the following.

A base project is built depending on profiles. The used profile
determines the appended classifier.
Another project depends on the previous base project, and is also built
depending on profiles. Also the used profile determines de appended
classifier.
Finally, a thir project depends on the second one. In it's dependencies
section specifies for which specific classifier is looking for. This
dependency is successfully resolved, but, when the second project is
resolving it's dependencies, fails determining the dependency as the
classifier value is not properly set by the profile.

Here you can see the snippets of the three pom files.

base pom.xml

Has nothing interesting but the classifier configuration of the
maven-jar-plugin

<classifier>${classifier}</classifier>

This value is set from a property defined in the profiles.xml file of
this same project, a value for example is "local"

A pom.xml, depends on the base.jar project like this

<dependencies>
    <dependency>
       <groupId>the.group</groupId>
       <artifactId>the-artifact</artifactId>
       <version>x.y.z-SNAPSHOT</version>
       <classifier>${classifier}</classifier>
    </dependency>
</dependencies>

As you may guess, the classifier value this time is set from A's
profile.xml file and the value can be, as previously, "local".
This dependency is successfully resolved and the jar is included in the
final build successfully

B pom.xml depends on A project like this

<dependencies>
    <dependency>
       <groupId>the.group</groupId>
       <artifactId>the-artifact</artifactId>
       <version>x.y.z-SNAPSHOT</version>
       <classifier>${classifier}</classifier>
    </dependency>
</dependencies>

Works all the same as the previous situation, but, when A is to resolve
it's dependencies, cannot retrieve the base.jar successfully as looks for
the.group:the-artifact:jar:${classifier}:x.y.z-SNAPSHOT which obviously
doesn't exist.

Has anyone already come up with this and solved it?
Should it be a bug?

Thanks in advance.
Carlos.

-- 
Carlos Alonso Pérez
Unkasoft Development Department
Junior Programmer

E-mail: calonso@unkasoft.com
Phone: +34 902 110 368
Mobile: +34 653 67 47 07
Fax: +34 923 19 77 84
Web site:  www.unkasoft.com 
Join GameSpace community at http://unkasoft.mobi 



C/Segunda nº 2, 1º izqda, C-D, 
P.I. Montalvo III, 
37188 - Carbajosa de la Sagrada 
Salamanca - SPAIN 


This message may contain confidential information or privileged material,
and is intended only for the individual(s) named. If you are not in the
named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system. E-mail
transmission cannot be guaranteed to be secure or error-free as information
could be intercepted, corrupted, lost, destroyed, arrive late or incomplete,
or contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message which arise as a result
of e-mail transmission. If verification is required please request a
hard-copy version.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org