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

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

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

Mark Raynsford
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

attachment0 (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

rfscholte
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  
<[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Mark Raynsford
On 2018-02-20T18:29:10 +0100
"Robert Scholte" <[hidden email]> 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


attachment0 (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Mark Raynsford
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


attachment0 (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Paul King
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
<[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Mark Raynsford
On 2018-02-24T09:47:02 +1000
Paul King <[hidden email]> 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


attachment0 (235 bytes) Download Attachment