You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Martin Desruisseaux <ma...@geomatys.com> on 2024/05/18 11:43:19 UTC
Trying to test the reworked compiler plugin
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
Re: Trying to test the reworked compiler plugin
Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 2024-05-21 à 11 h 18, Guillaume Nodet a écrit :
> https://github.com/Geomatys/maven/commit/5165ca60a1b44cd2a376cd1bfe48f558a2cbd54f
> looks interesting, as the interface was introduced in 4.x branch, so no
> need to keep it as it's not used anymore. Feel free to create a proper PR.
Thanks, done. What about the duplicated implementation classes? (e.g.
two |DefaultModelVersionParser|, and I think they are some other
duplicates). Do we need to keep both?
Martin
Re: Trying to test the reworked compiler plugin
Posted by Guillaume Nodet <gn...@apache.org>.
And
https://github.com/Geomatys/maven/commit/5165ca60a1b44cd2a376cd1bfe48f558a2cbd54f
looks interesting, as the interface was introduced in 4.x branch, so no
need to keep it as it's not used anymore. Feel free to create a proper PR.
Le mar. 21 mai 2024 à 11:15, Guillaume Nodet <gn...@apache.org> a écrit :
>
>
> Le lun. 20 mai 2024 à 11:37, Tamás Cservenák <ta...@cservenak.net> a
> écrit :
>
>> Howdy,
>>
>> maven-plugin-tools: We agreed with Guillaume to split it: instead of
>> mvn4, master will be "maven 4" and we will introduce a maven-3.x branch for
>> Maven3 support. Currently the master was meant to support both (maven3 and
>> maven4 plugins), but it proved problematic, hence the split. A plugin
>> cannot be both anyway, it is this or that hence the user can choose which
>> version, 3.x or 4.x wants to use.
>> plugin-testing: AFAIK, same stands here, due huge difference how those
>> operate (maven-core vs new maven API).
>>
>> This is all yet to be done.
>>
>> @Guillaume Nodet <gn...@apache.org> ping
>>
>
> I'm trying to fix the remaining issues to release beta. Once that's done,
> we can upgrade the m-plugin-p and m-plugin-tools to beta.
> And yes, we should remove the `mvn4` branches from those 2 components.
>
>
>>
>> Thanks
>> T
>>
>> On Sat, May 18, 2024 at 1:44 PM Martin Desruisseaux <
>> martin.desruisseaux@geomatys.com> wrote:
>>
>>> 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
>>>
>>>
>
> --
> ------------------------
> Guillaume Nodet
>
>
--
------------------------
Guillaume Nodet
Re: Trying to test the reworked compiler plugin
Posted by Guillaume Nodet <gn...@apache.org>.
Le lun. 20 mai 2024 à 11:37, Tamás Cservenák <ta...@cservenak.net> a écrit :
> Howdy,
>
> maven-plugin-tools: We agreed with Guillaume to split it: instead of mvn4,
> master will be "maven 4" and we will introduce a maven-3.x branch for
> Maven3 support. Currently the master was meant to support both (maven3 and
> maven4 plugins), but it proved problematic, hence the split. A plugin
> cannot be both anyway, it is this or that hence the user can choose which
> version, 3.x or 4.x wants to use.
> plugin-testing: AFAIK, same stands here, due huge difference how those
> operate (maven-core vs new maven API).
>
> This is all yet to be done.
>
> @Guillaume Nodet <gn...@apache.org> ping
>
I'm trying to fix the remaining issues to release beta. Once that's done,
we can upgrade the m-plugin-p and m-plugin-tools to beta.
And yes, we should remove the `mvn4` branches from those 2 components.
>
> Thanks
> T
>
> On Sat, May 18, 2024 at 1:44 PM Martin Desruisseaux <
> martin.desruisseaux@geomatys.com> wrote:
>
>> 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
>>
>>
--
------------------------
Guillaume Nodet
Re: Trying to test the reworked compiler plugin
Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Tamas
Thanks for the explanation. Then I will pause the Maven compiler plugin
work for now and resume after the new master branches are ready (I need
to focus on 2 meetings in June anyway). Just for avoiding confusion,
would it be possible to delete the current "mvn4" branches?
Side note: if the "master" branch is going to be very different than the
current branch, would it be an opportunity to rename "master" as "main"?
It could be done by creating a new Maven 4 branch named "main", make it
the default when ready, then rename current "master" as "maven-3.x".
Martin
Le 2024-05-20 à 11 h 36, Tamás Cservenák a écrit :
> Howdy,
>
> maven-plugin-tools: We agreed with Guillaume to split it: instead of mvn4,
> master will be "maven 4" and we will introduce a maven-3.x branch for
> Maven3 support. Currently the master was meant to support both (maven3 and
> maven4 plugins), but it proved problematic, hence the split. A plugin
> cannot be both anyway, it is this or that hence the user can choose which
> version, 3.x or 4.x wants to use.
> plugin-testing: AFAIK, same stands here, due huge difference how those
> operate (maven-core vs new maven API).
>
> This is all yet to be done.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Trying to test the reworked compiler plugin
Posted by Tamás Cservenák <ta...@cservenak.net>.
Howdy,
maven-plugin-tools: We agreed with Guillaume to split it: instead of mvn4,
master will be "maven 4" and we will introduce a maven-3.x branch for
Maven3 support. Currently the master was meant to support both (maven3 and
maven4 plugins), but it proved problematic, hence the split. A plugin
cannot be both anyway, it is this or that hence the user can choose which
version, 3.x or 4.x wants to use.
plugin-testing: AFAIK, same stands here, due huge difference how those
operate (maven-core vs new maven API).
This is all yet to be done.
@Guillaume Nodet <gn...@apache.org> ping
Thanks
T
On Sat, May 18, 2024 at 1:44 PM Martin Desruisseaux <
martin.desruisseaux@geomatys.com> wrote:
> 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
>
>