dependency:tree without building the project (why does dependency:tree needs project artifacts installed?)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

dependency:tree without building the project (why does dependency:tree needs project artifacts installed?)

Anton Vodonosov
Hello,

Can anyone explain why "mvn dependency:tree" fails if the project artifacts are absent in ~/.m2?

Also, if I place an empty, dummy file in place of the artifact in ~/.m2 dependency:tree starts working.
This means the artifact content is not needed for that operation.

Can this be worked around somehow, to allow producing project dependency without building the project?

Best regards,
- Anton

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dependency:tree without building the project (why does dependency:tree needs project artifacts installed?)

Francois MAROT
Hello,

maybe the workaround indicated here will help you:
http://maven.40175.n5.nabble.com/Finding-SNAPSHOT-dependencies-without-compiling-first-td5998636.html#a5998639
But I'm not confident on the rasons why it works like this...


*- - - - -François Marot*


On Mon, 6 Jul 2020 at 23:16, Anton Vodonosov <[hidden email]> wrote:

> Hello,
>
> Can anyone explain why "mvn dependency:tree" fails if the project
> artifacts are absent in ~/.m2?
>
> Also, if I place an empty, dummy file in place of the artifact in ~/.m2
> dependency:tree starts working.
> This means the artifact content is not needed for that operation.
>
> Can this be worked around somehow, to allow producing project dependency
> without building the project?
>
> Best regards,
> - Anton
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: dependency:tree without building the project (why does dependency:tree needs project artifacts installed?)

Nick_S
That was not a workaround, but me trying to reproduce the problem. I wasn't
able to reproduce it.

All the artifacts in the reactor could be found without building them. Are
you maybe trying to only build one module instead of the reactor?

With regards,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Tue, Jul 7, 2020 at 9:17 PM Francois Marot <[hidden email]>
wrote:

> Hello,
>
> maybe the workaround indicated here will help you:
>
> http://maven.40175.n5.nabble.com/Finding-SNAPSHOT-dependencies-without-compiling-first-td5998636.html#a5998639
> But I'm not confident on the rasons why it works like this...
>
>
> *- - - - -François Marot*
>
>
> On Mon, 6 Jul 2020 at 23:16, Anton Vodonosov <[hidden email]> wrote:
>
> > Hello,
> >
> > Can anyone explain why "mvn dependency:tree" fails if the project
> > artifacts are absent in ~/.m2?
> >
> > Also, if I place an empty, dummy file in place of the artifact in ~/.m2
> > dependency:tree starts working.
> > This means the artifact content is not needed for that operation.
> >
> > Can this be worked around somehow, to allow producing project dependency
> > without building the project?
> >
> > Best regards,
> > - Anton
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: dependency:tree without building the project (why does dependency:tree needs project artifacts installed?)

Anton Vodonosov
Hi, thank you for the responses.

Currently I was trying on a multi-module project, and

    mvn dependency:tree

fails complaining about the impossibility to find artifact for one of the reactor modules, but

    mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:tree

works. I've tried to debut a little but was unable to understand the reason.

So you say it should work for the whole project, but can fail if we specify a subset of modules?

In the past me and my colleagues were always building the project when studying the dependency tree.
I don't remember when it failed, for the whole project or maybe we encountered failures
when specifying specific modules using the -pl option.

I will follow up if I have more info.

Best regards,
- Anton

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: dependency:tree without building the project (why does dependency:tree needs project artifacts installed?)

Nick_S
Hi,

If you run maven dependency:tree, which version of the
maven-dependency-plugin do you see?
(Look for something like:
   [INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ your-module
)

And if it is something other than 3.1.2:
* Why aren't you using the latest version?
* Why don't you specify the plugins you are using in the pluginManagement
section of your company pom?

Ensuring the build environment is consistent is critical. Use the
pluginManagement section in the parent POM to declare explicit plugin
versions. This will nail down the plugin environment, removing potential
future conflicts. It’s still good practice to regularly check for and
update to the latest versions.

Hth,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Thu, Jul 9, 2020 at 12:37 AM Anton Vodonosov <[hidden email]>
wrote:

> Hi, thank you for the responses.
>
> Currently I was trying on a multi-module project, and
>
>     mvn dependency:tree
>
> fails complaining about the impossibility to find artifact for one of the
> reactor modules, but
>
>     mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:tree
>
> works. I've tried to debut a little but was unable to understand the
> reason.
>
> So you say it should work for the whole project, but can fail if we
> specify a subset of modules?
>
> In the past me and my colleagues were always building the project when
> studying the dependency tree.
> I don't remember when it failed, for the whole project or maybe we
> encountered failures
> when specifying specific modules using the -pl option.
>
> I will follow up if I have more info.
>
> Best regards,
> - Anton
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>