Skip to content

cstamas/jsr330

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven JSR330 migration test-set

At root there is a maven-plugin project. In it, the TestMojo is totally irrelevant, it is the org.cstamas.jsr330.components package that is interesting.

It contains a variations of component chains, picked up by Maven Core as extension points. The point chosen is ProjectExecutionListener but it could be really any extension point. The support classes are also irrelevant, they just simplify test classes and print out creation order (in ctor).

Each component class name is either S as "Sisu component" (uses JSR330 and is on Sisu index) or P as "Plexus component" (uses Plexus annotations and is in plexus.xml).

The goal is to check object graph construction if graph crosses boundaries between Sisu and Plexus.

Object graphs (chains):

  • P1PP -> P2P -> P3
  • P1PS -> P2S -> S3
  • P1SP -> S2P -> P3
  • P1SS -> S2S -> S3
  • S1PP -> P2P -> P3
  • S1PS -> P2S -> S3
  • S1SP -> S2P -> P3
  • S1SS -> S2S -> S3

Run it

  1. check out this project, install it mvn install (as latest test projects use plugin from local repo)
  2. step into test grounds cd testgrounds and execute sample projects with Maven 3.9.16, 3.10.0-rc-1 (and 4.0, 4.1...)

In test groounds there are two projects:

  • simple
  • simple-extensions (sets extensions=true for the plugin)

Both use test root plugin goal test bound to initialize phase. Execute goal mvn verify and check output.

Observations

If we consider Maven 3.9.16 as "correctly behaving", the results are this:

  • simple - no P or S components are created, as plugin is not set as extensions=true. Hence, extensions from it are not picked up at all.
  • simple-extensions - all P and S components are created, as plugin extensions are picked up.

With all the other Maven versions (migrated to JSR330), so 3.10.0-rc-1, 4.0 and 4.1, the results are this:

  • simple - Errors out with [ERROR] Unable to provision...
  • simple-extensions - works as expected.

I debugged it, and the error happens while constructing Plexus beans, as "realm visibility" filters out potential dependency components. The issue, is that those plexus beans should not be picked up at all in first case, but they are.

Hence, I did a change in Sisu https://github.com/eclipse-sisu/sisu-project/commit/1617ed86d9c17eb3805aaae9ad185b7d67d7f865 than when a Plexus component is being constructed, the TCCL is set for a moment. And result is, that with this fix, both projects behave same (as they would be extensions=true). And hence, I consider the fix wrong.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages