Hello all
I'm trying to run the tests on the reworked compiler plugin for Maven 4,
but execution is having an issue with Maven dependency injection. Before
to give more details, I would like to check if I'm up to date.
Three months ago, I was told to use the following branches:
* Maven core from https://github.com/apache/maven
* Plugin tools from https://github.com/apache/maven-plugin-tools/pull/242
* Plugin testing from
https://github.com/apache/maven-plugin-testing/pull/39
* Compiler from https://github.com/apache/maven-compiler-plugin/pull/147
I have kept my "Maven core" clone up-to-date. Other pull requests seem
to have no new commits, but the master branches on which they are based
have been updated. I wanted to search if more up-to-date Maven 4
branches exist somewhere else, but the situation is a bit confusing:
* There is "mvn4" branches on many plugin repositories, but they are 2
years old. Would it be possible to either update them or delete them?
* I found no code other than above pull requests that I could identify
as designed for Maven 4. If the above pull requests are not ready to
be merged, would it be possible to turn them as branches on Maven
repositories, possibly replacing the previous "mvn4" branches? The
goal is to make easy to find the most up-to-date code.
If the above pull requests are the most up-to-date code for Maven 4,
would it be possible to update them to "4.0.0-beta-2"? I tried to do
that on my side, but got some difficulties. First, it seems that the
following changes must be applied on Maven core for making possible to
compile the plugins:
*
https://github.com/Geomatys/maven/commit/5165ca60a1b44cd2a376cd1bfe48f558a2cbd54f
I have not created a pull request for the above because I'm not sure if
I understood the issue correctly. Next, after changing the dependencies
to "4.0.0-beta-3-SNAPSHOT", the build of "maven-plugin-testing-harness"
has the following test failure:
java.lang.IllegalArgumentException: session is null
at org.apache.maven.internal.impl.Utils.cast(Utils.java:44)
at
org.apache.maven.internal.impl.InternalSession.from(InternalSession.java:45)
at
org.apache.maven.project.DefaultProjectBuilder$BuildSession.<init>(DefaultProjectBuilder.java:291)
at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:135)
at
org.apache.maven.plugin.testing.MojoRule.readMavenProject(MojoRule.java:276)
at
org.apache.maven.plugin.testing.MojoRule.lookupConfiguredMojo(MojoRule.java:296)
at
org.apache.maven.plugin.testing.MojoRuleTest.testLookupInitializedMojo(MojoRuleTest.java:165)
The code producing the null value is:
static InternalSession from(org.eclipse.aether.RepositorySystemSession
session) {
return cast(InternalSession.class, session.getData().get(InternalSession.class),
"session");
}
It seems related to the issue that I'm having with the compiler plugin,
where the following annotated field:
/**
* The current build session instance.
*/
@Inject
protected Session session;
Stay null during the test execution. Is there any advise about how to
proceed? For me, the ideal would be to have the "mvn4" branches in at
least "maven-plugin-tools", "apache/maven-plugin-testing" and
"maven-compiler-plugin" replaced by up-to-date branches (I wlll take
care of rebasing my work on an up-to-date compiler branch).
Thanks,
Martin