POM parent/import relationship visualization

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

POM parent/import relationship visualization

Tomo Suzuki
Hi Maven users,

Do you know any visualization tool to show relationship (import/parent) of
POMs?

Background:
Today, I encountered a situation where I had to dig parent/import
relationship of multiple POMs. I had to read pom.xml via search.maven.org
for each POM artifact.
Detail:
https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/1001 .
I wish I can troubleshoot in a better way next time.

Regards,
Tomo

--
Regards,
Tomo
Reply | Threaded
Open this post in threaded view
|

Re: POM parent/import relationship visualization

Marco Schulz
Hi Tomo

Use the actual NetBeans IDE. open your mvn child project into netbens - the IDE is perfect for mvn projecst. just open, no imports. open the pom in the editor and choose the effectiv pom tab.
this view shows you the full argregated pom and where the entries comes from.

hopefully this is what you was looking for.
regrads
. marco

Sent from Outlook Mobile<https://aka.ms/blhgte>

________________________________
From: Tomo Suzuki <[hidden email]>
Sent: Monday, October 28, 2019 7:58:35 PM
To: Maven Users List <[hidden email]>
Subject: POM parent/import relationship visualization

Hi Maven users,

Do you know any visualization tool to show relationship (import/parent) of
POMs?

Background:
Today, I encountered a situation where I had to dig parent/import
relationship of multiple POMs. I had to read pom.xml via search.maven.org
for each POM artifact.
Detail:
https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/1001 .
I wish I can troubleshoot in a better way next time.

Regards,
Tomo

--
Regards,
Tomo
Reply | Threaded
Open this post in threaded view
|

Re: POM parent/import relationship visualization

Tomo Suzuki
Hi Marco,

Thank you for response. NetBeans' "Effective" almost worked. It showed the problematic artifact "grpc-api:1.24.0", which I was looking for, and showed it's from "grpc-bom". Great. But I also want to see where this grpc-bom coming from. 



Regards,
Tomo
Reply | Threaded
Open this post in threaded view
|

Re: POM parent/import relationship visualization

Andy Feldman
In reply to this post by Tomo Suzuki
Would `mvn dependency:tree -Dverbose -Dincludes=grpc-api` work in this
case? The documentation uses it in a very similar situation, to find out
the transitive dependency path to two different versions of the same
dependency:
https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html



On Mon, Oct 28, 2019 at 6:58 PM Tomo Suzuki <[hidden email]>
wrote:

> Hi Maven users,
>
> Do you know any visualization tool to show relationship (import/parent) of
> POMs?
>
> Background:
> Today, I encountered a situation where I had to dig parent/import
> relationship of multiple POMs. I had to read pom.xml via search.maven.org
> for each POM artifact.
> Detail:
> https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/1001 .
> I wish I can troubleshoot in a better way next time.
>
> Regards,
> Tomo
>
> --
> Regards,
> Tomo
>
Reply | Threaded
Open this post in threaded view
|

Re: POM parent/import relationship visualization

Thomas Broyer-2
Fwiw, you don't need NetBeans to get the effective POM: `mvn
help:effective-pom -Dverbose` should do.
https://maven.apache.org/plugins/maven-help-plugin/effective-pom-mojo.html

On Tue, Oct 29, 2019 at 5:55 PM Andy Feldman <[hidden email]> wrote:

> Would `mvn dependency:tree -Dverbose -Dincludes=grpc-api` work in this
> case? The documentation uses it in a very similar situation, to find out
> the transitive dependency path to two different versions of the same
> dependency:
>
> https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html
>
>
>
> On Mon, Oct 28, 2019 at 6:58 PM Tomo Suzuki <[hidden email]>
> wrote:
>
> > Hi Maven users,
> >
> > Do you know any visualization tool to show relationship (import/parent)
> of
> > POMs?
> >
> > Background:
> > Today, I encountered a situation where I had to dig parent/import
> > relationship of multiple POMs. I had to read pom.xml via
> search.maven.org
> > for each POM artifact.
> > Detail:
> > https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/1001
> .
> > I wish I can troubleshoot in a better way next time.
> >
> > Regards,
> > Tomo
> >
> > --
> > Regards,
> > Tomo
> >
>


--
Thomas Broyer
/tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>
Reply | Threaded
Open this post in threaded view
|

Re: POM parent/import relationship visualization

Tomo Suzuki
Hi Andy,
"mvn dependency:tree" did not explain why I get grpc-api:1.24.0 in
"dependencyManagement" section.

Hi Thomas,
Thank you. It worked in the same way as NetBeans:

  $ mvn help:effective-pom -Dverbose
  ...
      <dependency>
        <groupId>io.grpc</groupId>  <!-- io.grpc:grpc-bom:1.24.0, line 45
-->
        <artifactId>grpc-api</artifactId>  <!-- io.grpc:grpc-bom:1.24.0,
line 46 -->
        <version>1.24.0</version>  <!-- io.grpc:grpc-bom:1.24.0, line 47 -->
      </dependency>



*What I'm looking for*
Given the effective pom containing grpc-api:1.24.0, I'm looking for this
parent/import information:

com.google.cloud:google-cloud-bom:0.116.1-alpha-SNAPSHOT
  *importing* com.google.cloud:google-cloud-automl:0.114.0-beta  in
dependencyManagement section
    *inheriting* com.google.cloud:google-cloud-automl-parent:0.114.0-beta
      *importing* io.grpc:grpc-bom:1.24.0  in dependencyManagement section
        *containing* io.grpc:grpc-api:1.24.0 in dependencyManagement section


Is there any tool to help this?
Reply | Threaded
Open this post in threaded view
|

Re: POM parent/import relationship visualization

Mark Eggers-2
In reply to this post by Tomo Suzuki

On 10/29/2019 9:01 AM, Tomo Suzuki wrote:

> Hi Marco,
>
> Thank you for response. NetBeans' "Effective" almost worked. It showed the
> problematic artifact "grpc-api:1.24.0", which I was looking for, and showed
> it's from "grpc-bom". Great. But I also want to see where this grpc-bom
> coming from.
>
> [image: image.png]
>
> Regards,
> Tomo
>
There is also a graph layout for poms in NetBeans as well. It shows
parent-child relationships of dependencies, and will show if a single
dependency has multiple parents.

Unfortunately, the graph zoom functionality seems to be missing in 11.1
of the IDE. It was there in 8.2. I haven't downloaded 11.2 yet (almost
released) to see if the graph zoom functionality has made it back in. If
not, I should probably open up an enhancement request.

. . . just my two cents
/mde/



signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: POM parent/import relationship visualization

Tomo Suzuki
Hi Mark,

Thank you for response. I tried "Graph" button with NetBeans 11.0, but it didn't help my case:


On Tue, Oct 29, 2019 at 1:51 PM Mark Eggers <[hidden email]> wrote:

On 10/29/2019 9:01 AM, Tomo Suzuki wrote:
> Hi Marco,
>
> Thank you for response. NetBeans' "Effective" almost worked. It showed the
> problematic artifact "grpc-api:1.24.0", which I was looking for, and showed
> it's from "grpc-bom". Great. But I also want to see where this grpc-bom
> coming from.
>
> [image: image.png]
>
> Regards,
> Tomo
>

There is also a graph layout for poms in NetBeans as well. It shows
parent-child relationships of dependencies, and will show if a single
dependency has multiple parents.

Unfortunately, the graph zoom functionality seems to be missing in 11.1
of the IDE. It was there in 8.2. I haven't downloaded 11.2 yet (almost
released) to see if the graph zoom functionality has made it back in. If
not, I should probably open up an enhancement request.

. . . just my two cents
/mde/




--
Regards,
Tomo