You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Raynsford <or...@io7m.com> on 2018/02/20 17:05:18 UTC

Getting a list of "to be modularized" dependencies in topological order?

Hello.

I'm trying to get to the (possibly masochistic) position of having all
of my projects (and therefore by extension, all dependencies of all of
my projects) fully modularized. That is, every artifact in the
dependency tree should have a module-info.class file in it.

Part of the reason for doing this is that jlink can't work with
automatic modules.

What I would like to be able to do is, for an arbitrary Maven project,
get a list of all of the (transitive) dependencies of the project that
are currently either automatic modules, or not modules at all. Then,
the list needs to be sorted topologically (so that dependencies on the
leaves of the tree are listed first). This lets me know the most
efficient order in which to update dependencies.

Is there a plugin available that can do this? I've not been able to
find anything.

-- 
Mark Raynsford | http://www.io7m.com

Re: New JDK 9 module chasing tool (was: Getting a list of "to be modularized" dependencies in topological order?)

Posted by Mark Raynsford <or...@io7m.com>.
On 2018-02-24T09:47:02 +1000
Paul King <pa...@gmail.com> wrote:

> Looks good.
> 
> A small bit of feedback.  I tried using it on a project (Groovy) with
> an "all" artifact that has no jar - just references other jars. Even
> when I specified "<type>pom</type>" it tried to look for the jar
> artifact. Despite the error stacktrace it continued and still seemed
> to produce the correct result. I don't know whether it's possible to
> reduce such noise.

Interesting. Could you file a bug?

There's a known problem in that if the root project you're analyzing
isn't in Maven Central, you will see a (harmless) error stacktrace as
the resolver tries to resolve it from Central. There's an easy fix for
this, I just haven't done it yet. 

-- 
Mark Raynsford | http://www.io7m.com


Re: New JDK 9 module chasing tool (was: Getting a list of "to be modularized" dependencies in topological order?)

Posted by Paul King <pa...@gmail.com>.
Looks good.

A small bit of feedback.  I tried using it on a project (Groovy) with
an "all" artifact that has no jar - just references other jars. Even
when I specified "<type>pom</type>" it tried to look for the jar
artifact. Despite the error stacktrace it continued and still seemed
to produce the correct result. I don't know whether it's possible to
reduce such noise.

Cheers, Paul.


On Sat, Feb 24, 2018 at 2:27 AM, Mark Raynsford
<or...@io7m.com> wrote:
> I've published a plugin here:
>
> https://github.com/io7m/modulechaser
>
> It produces a standalone XHTML report detailing the modularization
> status of the transitive dependencies of any project you point it at.
> The status table is presented in reverse-topological order; start
> bugging maintainers at the top first and work downwards. :)
>
> A report produced for:
>
>   https://github.com/io7m/universe
>
> ... Looks like this:
>
>   https://ataxia.io7m.com/2018/02/23/modules.xhtml
>
> The project has had minimal testing, so there are likely to be issues.
> It more or less delegates all of the actual work to the various Maven
> dependency analysis code. Please let me know if it chokes on anything
> you'd consider to be reasonable.
>
> I'm still waiting to be able to push this to Central - I've run into
> what appears to be a compatibility issue with the version of libgpg used
> on Maven Central. I've filed a ticket with Sonatype and am just waiting
> for them to upgrade their infrastructure. Until that happens, you'll
> have to clone and "mvn install" this yourself. Sorry!
>
> --
> Mark Raynsford | http://www.io7m.com
>

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


New JDK 9 module chasing tool (was: Getting a list of "to be modularized" dependencies in topological order?)

Posted by Mark Raynsford <or...@io7m.com>.
I've published a plugin here:

https://github.com/io7m/modulechaser

It produces a standalone XHTML report detailing the modularization
status of the transitive dependencies of any project you point it at.
The status table is presented in reverse-topological order; start
bugging maintainers at the top first and work downwards. :)

A report produced for:

  https://github.com/io7m/universe

... Looks like this:

  https://ataxia.io7m.com/2018/02/23/modules.xhtml

The project has had minimal testing, so there are likely to be issues.
It more or less delegates all of the actual work to the various Maven
dependency analysis code. Please let me know if it chokes on anything
you'd consider to be reasonable.

I'm still waiting to be able to push this to Central - I've run into
what appears to be a compatibility issue with the version of libgpg used
on Maven Central. I've filed a ticket with Sonatype and am just waiting
for them to upgrade their infrastructure. Until that happens, you'll
have to clone and "mvn install" this yourself. Sorry!

-- 
Mark Raynsford | http://www.io7m.com


Re: Getting a list of "to be modularized" dependencies in topological order?

Posted by Mark Raynsford <or...@io7m.com>.
On 2018-02-20T18:29:10 +0100
"Robert Scholte" <rf...@apache.org> wrote:

> When running Maven with Java9+ and running 'mvn dependency:resolve' on  
> your project, you'll see all the module names and if these modules are  
> automatic modules.
> It is a list, not a tree, but that's probably the closest you can get  
> right now.
> 

OK, thanks.

I think I need to write a plugin!

-- 
Mark Raynsford | http://www.io7m.com


Re: Getting a list of "to be modularized" dependencies in topological order?

Posted by Robert Scholte <rf...@apache.org>.
When running Maven with Java9+ and running 'mvn dependency:resolve' on  
your project, you'll see all the module names and if these modules are  
automatic modules.
It is a list, not a tree, but that's probably the closest you can get  
right now.

thanks,
Robert

On Tue, 20 Feb 2018 18:05:18 +0100, Mark Raynsford  
<or...@io7m.com> wrote:

> Hello.
>
> I'm trying to get to the (possibly masochistic) position of having all
> of my projects (and therefore by extension, all dependencies of all of
> my projects) fully modularized. That is, every artifact in the
> dependency tree should have a module-info.class file in it.
>
> Part of the reason for doing this is that jlink can't work with
> automatic modules.
>
> What I would like to be able to do is, for an arbitrary Maven project,
> get a list of all of the (transitive) dependencies of the project that
> are currently either automatic modules, or not modules at all. Then,
> the list needs to be sorted topologically (so that dependencies on the
> leaves of the tree are listed first). This lets me know the most
> efficient order in which to update dependencies.
>
> Is there a plugin available that can do this? I've not been able to
> find anything.

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