Hi, If you remove all traces of jruby-engine from your local repo, you will see that in second case maven will try to download both pom (which is missing, more on that below) and the classified jar. It does not try to download the jar in the first case because it is referred to from a dependency that is marked as provided (your snippet). Please consult [1] and note where it says that provided scope is not transitive.
As for classifiers, those are only used on artifacts themselves, not on pom. So the pom at [2] is completely wrong and will never be picked up by maven. Typical use case is a single project pom and several artifacts with different classifiers. [1] https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope [2] https://repository.mulesoft.org/nexus/content/repositories/public/javax/script/jruby-engine/1.1/jruby-engine-1.1-jdk14.pom 2015-06-24 13:55 GMT+03:00 Sören Daniel Krum <[email protected]>: > Hi! > > I found a strange behaviour when having a referring to a dependency > dependency with classifier in my pom: > > Let us say, my pom holds the following snippet: > > <dependencies> > <dependency> > <groupId>org.mule.modules</groupId> > <artifactId>mule-module-scripting</artifactId> > <version>3.6.0</version> > <scope>provided</scope> > </dependency> > > This strange mule thingy has a pom of its own, and in there is a > classified reference to javax.script:jruby-engine. > Then when calling > > # mvn dependency:resolve -U | grep jruby-engine > > i see the following log lines: > > Downloading: > https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/javax/script/jruby-engine/1.1/jruby-engine-1.1.pom > Downloading: > https://repository.mulesoft.org/releases/javax/script/jruby-engine/1.1/jruby-engine-1.1.pom > Downloading: > https://repository.mulesoft.org/nexus/content/repositories/public/javax/script/jruby-engine/1.1/jruby-engine-1.1.pom > Downloading: > https://repo.maven.apache.org/maven2/javax/script/jruby-engine/1.1/jruby-engine-1.1.pom > Downloading: > https://repository.mulesoft.org/nexus/content/repositories/public/javax/script/jruby-engine/1.1/jruby-engine-1.1.pom > [WARNING] The POM for javax.script:jruby-engine:jar:jdk14:1.1 is missing, > no dependency information available > > So, even if the warning says that they searched for the classified (jdk14) > version, the debugging says they tried a download without classifier. > > But when i add a direct dependency in my pom file like that: > > <dependency> > <groupId>javax.script</groupId> > <artifactId>jruby-engine</artifactId> > <version>1.1</version> > <classifier>jdk14</classifier> > </dependency> > > The log looks like that: > > Downloading: > https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/javax/script/jruby-engine/1.1/jruby-engine-1.1-jdk14.jar > Downloading: > https://repository.mulesoft.org/releases/javax/script/jruby-engine/1.1/jruby-engine-1.1-jdk14.jar > Downloading: > https://repository.mulesoft.org/nexus/content/repositories/public/javax/script/jruby-engine/1.1/jruby-engine-1.1-jdk14.jar > Downloaded: > https://repository.mulesoft.org/nexus/content/repositories/public/javax/script/jruby-engine/1.1/jruby-engine-1.1-jdk14.jar > (0 B at 0.0 KB/sec) > [INFO] javax.script:jruby-engine:jar:jdk14:1.1:compile > > Then they are really resolving the classifier and they really search for > the classified version. I attach a stripped down pom file, if someone wants > to give it a try... > > Am i missing something? Or is that considered to work like that? > > -- > Med vennlig hilsen / Mit freundlichem Gruß / Kind regards > > Sören Krum > System Ingeniør - System > UNINETT AS > www.uninett.no > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Regards, Anton.
