You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nick Stolwijk <ni...@gmail.com> on 2009/06/10 15:20:02 UTC

Re: maven-dependency-plugin doesn't find all dependencies in several repositories

If you use dependency:tree-output on project Z what is the scope of
the dependency? Then look at [1] to see the transitive scope of that
dependency. Probably the dependency is in the wrong scope.

[1] http://www.sonatype.com/books/maven-book/reference/pom-relationships-sect-transitive.html

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Wed, Jun 10, 2009 at 3:08 PM, gorgophol<be...@inter.de> wrote:
> dependency:tree-output

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


Re: maven-dependency-plugin doesn't find all dependencies in several repositories

Posted by gorgophol <be...@inter.de>.


gorgophol wrote:
> 
> Is it possible that the dependency-plugin uses information from
> localRepository instead of Repos 1 and 2?
> 
> I recognized the following behavior:
> 
> Every time I install an artifact into Repos 2 using deploy:file, the jar
> and the pom.xml are installed into correctly into Repos 2 (with all the
> correct dependency-entries in the pom.xml). but also the pom.xml of the
> artifact in my localRepository is replaced with a new one, containing no
> dependecies ... 
> 

I solved the problem by using the pomFile-parameter for the deploy-plugin.
Now a correct version of the pom.xml is stored in localRepository and so
dependency-plugin seems to locate all dependencies. 

Thanks a lot for your time and hints, which took me to the real reason of
the problem. 
Now work is a lot more fun again :-)
-- 
View this message in context: http://www.nabble.com/maven-dependency-plugin-doesn%27t-find-all-dependencies-in-several-repositories-tp23961970p24049425.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: maven-dependency-plugin doesn't find all dependencies in several repositories

Posted by gorgophol <be...@inter.de>.
Is it possible that the dependency-plugin uses information from
localRepository instead of Repos 1 and 2?

I recognized the follwoing behavior:

Every time I install an artifact into Repos 2 using deploy:file, the jar and
the pom.xml are installed into correctly into Repos 2 (with all the correct
dependency-entries in the pom.xml). but also the pom.xml of the artifact in
my localRepository is replaced with a new one, containing no dependecies ... 

Just for explanation: 
Artifact Z is built by another group and deployed in their own repository
using deploy-phase. Maven also installs it in localRepository in the
install-phase. If tests are ok, Artifact Z (and pom.xml) are deployed into
Repos 2, where other groups also may use it as dependency. As described
above, this seems to kill the pom.xml in localRepository. 

May be a bug in deploy-plugin? 
But dependency-plugin shouldn't use any information stored in
localRepositories in my oppinion!
-- 
View this message in context: http://www.nabble.com/maven-dependency-plugin-doesn%27t-find-all-dependencies-in-several-repositories-tp23961970p24034808.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: maven-dependency-plugin doesn't find all dependencies in several repositories

Posted by gorgophol <be...@inter.de>.


Nick Stolwijk-4 wrote:
> 
> 
> Because of this piece I think there is something wrong with the pom
> file of your Z artifact. Can you take a look in your local repository
> in the pom file of Z to see if the dependency is really compile? It
> shouldn't matter in which repo an artifact lives.
> 
> 

In my pom.xml of Z there are just these two dependencies. 

         <dependencies>
		<dependency>
			<groupId>org.apache</groupId>
			<artifactId>batik</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<groupId>org.objectweb</groupId>
			<artifactId>asm</artifactId>
			<version>1.5.3</version>
		</dependency>
	</dependencies>

That's my original part of Z's pom.xml. I never defined any scope in none of
my pom.xmls and dependenxy:tree for Z also shows compile. 

I also don't have any pure snapshot-repository. This special repository is
really only a "release-repository". So it should work I think, shouldn't it?


-- 
View this message in context: http://www.nabble.com/maven-dependency-plugin-doesn%27t-find-all-dependencies-in-several-repositories-tp23961970p24029230.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: maven-dependency-plugin doesn't find all dependencies in several repositories

Posted by Stephen Connolly <st...@gmail.com>.
2009/6/10 Nick Stolwijk <ni...@gmail.com>

> [quote]
> But there seems to be no way to get also Ex3 into that folder, because the
> dependency:tree-output doesn't even list Ex3.
> [/quote]
>
> Because of this piece I think there is something wrong with the pom
> file of your Z artifact. Can you take a look in your local repository
> in the pom file of Z to see if the dependency is really compile? It
> shouldn't matter in which repo an artifact lives.
>

Unless the artifact is a -SNAPSHOT artifact and you are pulling from a
repository with releases set to false...

I'll dig up the code... somebody helpfully found this strange bug in Maven's
core (found by the versions-maven-plugin)

http://jira.codehaus.org/browse/MVERSIONS-19

essentially, if you have

<repository>
<id>my-snapshot-repository</id>
<name>My Snapshot Repository</name>
<url>http://my.repo/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>

Then this method:

http://maven.apache.org/ref/current/xref/org/apache/maven/project/artifact/MavenMetadataSource.html#495

This method creates a RepositoryMetadata object of type:

http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#31

This metadata object is passed to the RepositoryMetadataManager:

http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#58

Which asks the RepositoryMetadata object if it is a snapshot...

http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#69

but our metadata object can never be a snapshot:

http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#81

So the end result is that we never look in non-release repositories... not
sure if this is a Maven bug or if we should be using a different method.


I tried getting one of the Maven developers to look into it, but had no
luck...


I am also not sure of the implications of changing the existing behaviour
w.r.t. updating the metadata that these functions seem to imply will get
updated.

>
> Hth,
>
> Nick Stolwijk
> ~Java Developer~
>
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
>
>
>
> On Wed, Jun 10, 2009 at 3:36 PM, gorgophol<be...@inter.de> wrote:
> >
> > Thanks for your fast reply.
> >
> > Scope for all dependencies is "compile".
> > In none of those POMs any <scope>-tag is used. It's all maven-standard
> > (compile).
> >
> > If any scope was "provided" or so, I would understand that it isn't
> copied.
> > But all other dependencies are copied.
> >
> > So I thought it might be because Z is in Repos2.
> > But that should be no problem in my opinion.
> > --
> > View this message in context:
> http://www.nabble.com/maven-dependency-plugin-doesn%27t-find-all-dependencies-in-several-repositories-tp23961970p23962522.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>

Re: maven-dependency-plugin doesn't find all dependencies in several repositories

Posted by Nick Stolwijk <ni...@gmail.com>.
[quote]
But there seems to be no way to get also Ex3 into that folder, because the
dependency:tree-output doesn't even list Ex3.
[/quote]

Because of this piece I think there is something wrong with the pom
file of your Z artifact. Can you take a look in your local repository
in the pom file of Z to see if the dependency is really compile? It
shouldn't matter in which repo an artifact lives.

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Wed, Jun 10, 2009 at 3:36 PM, gorgophol<be...@inter.de> wrote:
>
> Thanks for your fast reply.
>
> Scope for all dependencies is "compile".
> In none of those POMs any <scope>-tag is used. It's all maven-standard
> (compile).
>
> If any scope was "provided" or so, I would understand that it isn't copied.
> But all other dependencies are copied.
>
> So I thought it might be because Z is in Repos2.
> But that should be no problem in my opinion.
> --
> View this message in context: http://www.nabble.com/maven-dependency-plugin-doesn%27t-find-all-dependencies-in-several-repositories-tp23961970p23962522.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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


Re: maven-dependency-plugin doesn't find all dependencies in several repositories

Posted by gorgophol <be...@inter.de>.
Thanks for your fast reply. 

Scope for all dependencies is "compile".
In none of those POMs any <scope>-tag is used. It's all maven-standard
(compile). 

If any scope was "provided" or so, I would understand that it isn't copied. 
But all other dependencies are copied. 

So I thought it might be because Z is in Repos2. 
But that should be no problem in my opinion. 
-- 
View this message in context: http://www.nabble.com/maven-dependency-plugin-doesn%27t-find-all-dependencies-in-several-repositories-tp23961970p23962522.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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