You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Elliotte Rusty Harold <el...@ibiblio.org> on 2021/06/21 13:32:05 UTC

Modernizing maven-dependency-analyzer

Fixing https://issues.apache.org/jira/browse/MDEP-753 proved more
difficult than it should have been, primarily due to the age and
non-standard approach of a lot of its code. I was barely able to make
the tests run in Eclipse and never got them to pass. I thought I'd
throw out a few notes I made while working on this.

maven-dependency-analyzer is based on a more than a decade old version
of plexus injection. Trying to update that breaks a lot of tests. The
whole structure is very weird. The most confusing part is in
DefaultProjectDependencyAnalyzerTest (which are the most critical
tests we have for this library) that use very old versions of
BuildTool, ProjectTool, and RepositoryTool to set up integration
tests. I spent some time trying to modernize this but ultimately ran
aground on the problem that there's no Mojo in this library so I
couldn't use AbstractMojoTestCase.

Someone else might have more success than me if they feel like giving
it a try. There are some parts of this library that do nothing but
obscure its API, and that we could rip out if we were willing to ship
a modernized version with a new package and artifact ID. Dependency
injection, in particular, really doesn't help us here. It seems
possible to eliminate half the packages, half the classes, and all the
interfaces with no loss in functionality. The library is massively
over-engineered for what it does.

The key to improving this at all is going to be figuring out how to
compile a Maven project from inside a unit test in a more modern
fashion. Or perhaps these tests can be converted to integration tests
as in some of the oher projects. I'm not sure. If anyone can figure
that out, it would help move this dependency off of Maven 2 APIs and
make it much more amenable to fixes and enhancements in the future.


-- 
Elliotte Rusty Harold
elharo@ibiblio.org

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


Re: Modernizing maven-dependency-analyzer

Posted by Slawomir Jaranowski <s....@gmail.com>.
....
pon., 21 cze 2021 o 15:33 Elliotte Rusty Harold <el...@ibiblio.org>
napisał(a):

> Fixing https://issues.apache.org/jira/browse/MDEP-753 proved more
> difficult than it should have been, primarily due to the age and
> non-standard approach of a lot of its code. I was barely able to make
> the tests run in Eclipse and never got them to pass. I thought I'd
> throw out a few notes I made while working on this.
>
> maven-dependency-analyzer is based on a more than a decade old version
> of plexus injection. Trying to update that breaks a lot of tests. The
> whole structure is very weird. The most confusing part is in
> DefaultProjectDependencyAnalyzerTest (which are the most critical
> tests we have for this library) that use very old versions of
> BuildTool, ProjectTool, and RepositoryTool to set up integration
> tests. I spent some time trying to modernize this but ultimately ran
> aground on the problem that there's no Mojo in this library so I
> couldn't use AbstractMojoTestCase.
>
> Someone else might have more success than me if they feel like giving
> it a try. There are some parts of this library that do nothing but
> obscure its API, and that we could rip out if we were willing to ship
> a modernized version with a new package and artifact ID. Dependency
> injection, in particular, really doesn't help us here. It seems
> possible to eliminate half the packages, half the classes, and all the
> interfaces with no loss in functionality. The library is massively
> over-engineered for what it does.
>
> The key to improving this at all is going to be figuring out how to
> compile a Maven project from inside a unit test in a more modern
> fashion. Or perhaps these tests can be converted to integration tests
> as in some of the oher projects. I'm not sure. If anyone can figure
> that out, it would help move this dependency off of Maven 2 APIs and
> make it much more amenable to fixes and enhancements in the future.
>
>
> --
> Elliotte Rusty Harold
> elharo@ibiblio.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Hi,

My idea ...

Split project to modules:

- maven-dependency-analyzer - current code
- plugin-helper - simple plugin which use maven-dependency-analyzer
- it-tests - module with IT tests, we can use maven-invoker-plugin to
execute maven projects where will be used  plugin-helper

plugin-helper and  it-tests modules can be skipped from deployment

What do you think?

-- 
Sławomir Jaranowski