Skip to content

Require Maven 3.5.4+ #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Require Maven 3.5.4+ #12

wants to merge 1 commit into from

Conversation

slachiewicz
Copy link
Member

No description provided.

Copy link
Member

@dmatej dmatej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question - what is the intention of this change?
I tried to remember and google a bit ... and found just this: https://maven.apache.org/ref/3.9.1/maven-model/maven.html#class_prerequisites

For a plugin project (packaging is maven-plugin), the minimum version of Maven required to use the resulting plugin.
In Maven 2, this was also specifying the minimum version of Maven required to build a project, but this usage is deprecated in Maven 3 and not checked any more: use the Maven Enforcer Plugin's requireMavenVersion rule instead.

@slachiewicz
Copy link
Member Author

We are doing cleanup. Setting this property to 3.5.4 will force users to use newer Maven version.
We recommend to use Maven 3.8.x or 3.9.x for all projects.
See history: https://maven.apache.org/docs/history.html

@slachiewicz slachiewicz marked this pull request as ready for review May 2, 2023 15:51
@dmatej
Copy link
Member

dmatej commented May 2, 2023

We are doing cleanup. Setting this property to 3.5.4 will force users to use newer Maven version. We recommend to use Maven 3.8.x or 3.9.x for all projects. See history: https://maven.apache.org/docs/history.html

But then you are going backwards, because the maven-plugin-api here was already set to a newer version.
The prerequisity is rather a declaration of compatibility, I am not sure if it is our responsibility to force users to do anything. Basically this is a breaking change.

I thought it had some real base like "when users would use Mojohouse plugins with old Maven, they could cause some well defined disaster".

@slachiewicz
Copy link
Member Author

Previous setting to set prerequisites to 3.0 and then depends on newer plugin API was wrong and must be fixed.

@slachiewicz
Copy link
Member Author

Yes I'm aware that this is bigger change and we just do alignment in all our projects - this one is one of 100s.

@dmatej
Copy link
Member

dmatej commented May 2, 2023

Previous setting to set prerequisites to 3.0 and then depends on newer plugin API was wrong and must be fixed.

You can depend on newer versions.

However I would like to see some recommendation from Apache, current change smells (forcing the older api version which will be downloaded even if user would use the latest maven) and the original state smells too (declaring 3.0 but using 3.9.1, but finally that might be ok).

Btw I have found much more serious issue, after some time I tried to use the plugin with Maven 3.9.1 - and it failed. It is related to maven versions but has nothing to do with the API ...

@slachiewicz
Copy link
Member Author

Yes, I'm from Apache Maven project :-)

@slachiewicz
Copy link
Member Author

I saw that last release was created by You some time ago. If you prefer we could only sync prerequisites to declared API version. Will this be ok for You?

@dmatej
Copy link
Member

dmatej commented May 2, 2023

I saw that last release was created by You some time ago. If you prefer we could only sync prerequisites to declared API version. Will this be ok for You?

Ok, then please add it to FAQ on Maven, also Maven should print some warning. As this plugin is broken now with mvn 3.9.1 I started fixing that and also reconfigured GitHub Actions to be able to detect the issue.

However I am still thinking about it, because originally this plugin was to help especially to users using old maven versions and old JDK versions which don't support UTF-8 in property files. Later I have found that even then it is not so simple for all use cases and the plugin is still useful. So basically for me it is easier to go with Maven releases and just validate the backward compatibility by tests. This change does the opposite - defines maven version and then I have to prove that it works with latest maven too. Both ways are limited as these tests are not executed with every maven release.

I am bit surprised than Maven 4 still plans to support Java 8? I would expect to move directly to Java 17 (if not 21 - removal of Security Manager and finalizers will cause a lot of pain). https://maven.apache.org/docs/history.html

Sorry for my comments, I am trying to fully understand where do we go and why :-)

@dmatej
Copy link
Member

dmatej commented May 2, 2023

Btw with my fix it passed even with Maven 3.2.5 ... https://github.com/mojohaus/native2ascii-maven-plugin/actions/runs/4865104187/jobs/8674978200?pr=13 ... and now what ...?
If it would be a large system, I would simply agree to limit the range of supported versions, but here I am not sure.

@dmatej
Copy link
Member

dmatej commented May 2, 2023

There is yet one possible solution - to remove the <prerequisities> element so it would not provide confusing information.

@slachiewicz
Copy link
Member Author

Thx for all informations, I'll left to You to decide what is better for this plugin. Thx.

@dmatej
Copy link
Member

dmatej commented May 3, 2023

Thx for all informations, I'll left to You to decide what is better for this plugin. Thx.

Thank you for initiating this and all your time!

@dmatej dmatej deleted the maven-3.5.4 branch May 3, 2023 07:52
dmatej added a commit that referenced this pull request May 3, 2023
- Based on the discussion in PR #12
- The prerequisity should align with the maven-plugin-api dependency, but then
  it duplicates the information.
- If we would use latest api 3.9.1, users would be forced to use Maven 3.9.1+
- If we would use api 3.5.4, we would be stuck in the past and users would be
  forced to use maven 3.5.4
- Now we use api 3.9.1 but we don't limit users to use older or newer Maven
  versions. If they use too old Maven, it is their risk.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
dmatej added a commit that referenced this pull request May 3, 2023
- Based on the discussion in PR #12
- The prerequisity should align with the maven-plugin-api dependency, but then
  it duplicates the information.
- If we would use latest api 3.9.1, users would be forced to use Maven 3.9.1+
- If we would use api 3.5.4, we would be stuck in the past and users would be
  forced to use maven 3.5.4
- Now we use api 3.9.1 but we don't limit users to use older or newer Maven
  versions. If they use too old Maven, it is their risk.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants