Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Resolving dependencies from local pom.xml

Hi guys,

Thanks for your answers!

Let me explain my problem with more details. So I'm using the requiresDependencyResolution annotation, but in addition to that I really need the list of dependencies in order to sort them and output them into a text file.
Maybe I'm doing something wrong to get the list of dependencies...

I created a small example to reproduce my problem, you can download it here http://www.cern.ch/J/aether-example.zip

Let's go step by step:
  1. Install aether-maven-plugin by using "mvn install"
  2. From the other project consumer, call "mvn aether:test" and the output should be [test:consumer:jar:0.0.1-SNAPSHOT (compile), junit:junit:jar:4.10 (compile)], which is what I expect.
  3. Now modify the pom.xml to point to your Nexus instance, and call "mvn deploy". The artifact will be on your Nexus instance and in your local repository.
  4. Change the consumer/pom.xml dependencies (change for example the version of junit to 3.8), and call "mvn aether:test". Here again, the output is as expected [test:consumer:jar:0.0.1-SNAPSHOT (compile), junit:junit:jar:3.8 (compile)]
  5. Now remove the consumer artifact from your local repository, and call "mvn aether:test". The displayed Junit version will be 4.10 instead of 3.8, and this is problematic for me. I would expect to see version 3.8 from the local pom.xml, but instead the version is resolved from the remote repository.
I'm not sure why the behavior changes when the artifact is deleted from the local repository, it is quite obscure to me. But is there a way to force the collectRequest root to the current local pom.xml (line 57 and 60 in the source code)?

Again, thanks a lot for your help!
Jérémy


On Thu, Aug 23, 2012 at 12:24 AM, Benjamin Bentmann <bentmann@xxxxxxxxxxxx> wrote:
Jérémy wrote:

My goal is to resolve the dependencies of the current project where the
Maven plugin has been called from.

Usually, plugins can use the requiresDependencyResolution annotation [0] for this.


I experience 2 different behaviors, depending on the environment:
1) If an artifact of the current project already exists (either on Nexus or
in the local repository), the dependencies from the remote pom.xml will be
resolved.
2) If the environment is clean, the dependencies will come from the local
pom.xml, as I expect.

I don't quite understand, what is a "local pom.xml" and how exactly do you tell where dependencies were resolved from?


Benjamin


[0] http://maven.apache.org/developers/mojo-api-specification.html

_______________________________________________
aether-users mailing list
aether-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aether-users


Back to the top