Skip to content
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

Version 1.5.2 still contains Java 11 class files #27

Open
kriegaex opened this issue May 27, 2021 · 4 comments · May be fixed by #35
Open

Version 1.5.2 still contains Java 11 class files #27

kriegaex opened this issue May 27, 2021 · 4 comments · May be fixed by #35
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kriegaex
Copy link
Collaborator

kriegaex commented May 27, 2021

In #21, I see that you did something in order to enable builds with Java 8 target. But actually, version 1.5.2 on Maven Central still contains Java 11 class files, i.e. users need at least JDK 11 in order to build software when using your plugin. So the same error reported in #21 persists.

I cloned the repository and built my own version using profile java-8, and it runs flawlessly on JDK 8.

Please publish a new release 1.5.3, compiled correctly. It is not enough to just have the ability to compile for target 8, you also need to actually use it. 😉

P.S.: I am wondering why you even try to compile to target 11, if the source code (or at least the binaries) are still compatible with Java 8. What is the benefit, if you are not using recent language features?

@kriegaex
Copy link
Collaborator Author

kriegaex commented Jun 2, 2021

I just noticed that you did a lot of strange things in your Maven POM, like configuring <classifier>java8</classifier> for the plugin artifact in a special profile. The effect is that your GitHub workflow does build a specific Java 8 version, but it is deployed with the classifier added to its name, of course:

image

So on the one hand, on Maven Central you have two versions of the plugin. But nobody can use the Java 8 variant, because using a classifier tag in plugin specifications are illegal in Maven, i.e. you cannot do this:

image

Maven would say, when trying to run it like that:

[ERROR] Malformed POM (...): Unrecognised tag: 'classifier' (...)

Bottom line: Nice idea, but Maven simply does not work like this.

I am not sure why you made all that effort without any benefit and why anyone needs the Java 11 version at all. Maybe you thought that in your build profiles, having to deal with different JVM command line parameters when building on different JDKs, you would have to do it like that. But you can easily build the project with JDK 16 and tell the compiler to always produce Java 8 byte code. A plugin or dependency compiled to target 8 can still be used in all future JVM versions, but not the other way around. So I am going to create a pull request in order to get rid of all those variants and limitations.


Another problem in your POM is that you set this:

<prerequisites>
    <maven>${mavenVersion}</maven>
</prerequisites>

Why? This not only sets the minimum Maven version needed to build the plugin, but also the minimum version to run the plugin. I experimentally deactivated this prerequisite, and the plugin still works fine in Maven versions back to 3.0.5 - I did not test any lower. So why would you force the users of your plugin to use a minimum Maven version? Even if you use plugin API 3.6.3 like presently, the plugin still works on older Maven versions. Even if you upgrade to plugin API 3.8.1, the plugin should still run on Maven 3.0.5. So my PR will also remote that unnecessary limitation.

As for the minimum Maven version needed to build the plugin:

  • In theory it could also be build on a version lower than 3.6.3, maybe even down to 3.0.x.
  • But org.codehaus.mojo:license-maven-plugin:2.0.0 - which modifies the LICENSE file during each build, telling Git it was changed due to line feed type changes on Windows, which is also annoying - requires Maven 3.5.4.
  • Unfortunately, io.takari.maven.plugins:takari-lifecycle-plugin:2.0.0 actually requires Maven 3.6.3,
  • so that effectively the whole plugin must be built with 3.6.3, just like you configured it. But for this, you can use the Enforcer rule which you already have in place, not the prerequisites section. Then you enforce it for your own build, but the plugin users are free to run the plugin on a lower Maven version.

@kriegaex
Copy link
Collaborator Author

kriegaex commented Jun 2, 2021

If you need a bugfix, enabling the plugin to be used on

@heyitsmepatg
Copy link

Is there any update or workaround to enable the plugin on Java 8 runtimes?

@kriegaex
Copy link
Collaborator Author

kriegaex commented Mar 9, 2022

Why don't you just follow the link in my comment directly above yours? I have published a Java 8 version on Maven Central 9 months ago.

@Huluvu424242 Huluvu424242 moved this from Todo to In Progress in @Huluvu424242's plantuml-maven-plugin Dec 27, 2022
@Huluvu424242 Huluvu424242 linked a pull request Dec 27, 2022 that will close this issue
@Huluvu424242 Huluvu424242 linked a pull request Dec 27, 2022 that will close this issue
@Huluvu424242 Huluvu424242 self-assigned this Dec 28, 2022
@Huluvu424242 Huluvu424242 added the bug Something isn't working label Dec 28, 2022
@Huluvu424242 Huluvu424242 added this to the 1.6.0 milestone Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants