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

Minimal version of Java for this plugin ? #225

Closed
sbernard31 opened this issue Jun 17, 2022 · 9 comments
Closed

Minimal version of Java for this plugin ? #225

sbernard31 opened this issue Jun 17, 2022 · 9 comments
Labels

Comments

@sbernard31
Copy link

Sorry if I missed it but I didn't find any information about minimal java version required ?

The pom.xml seems to say it's java8. Some issues also go in that way : #35

But when I try to use it, I get :

Execution default-cli of goal com.github.ekryd.sortpom:sortpom-maven-plugin:3.1.3:sort failed: 

Unable to load the mojo 'sort' in the plugin 'com.github.ekryd.sortpom:sortpom-maven-plugin:3.1.3' 
due to an API incompatibility: 

org.codehaus.plexus.component.repository.exception.ComponentLookupException: sortpom/SortMojo has been compiled 
by a more recent version of the Java Runtime (class file version 55.0), 
this version of the Java Runtime only recognizes class file versions up to 52.0

Like if code was compiled for java 11 (API version 55.0)

So maybe this is just a mistake about jdk used to compile the released jar ?

(I will maybe use this plugin but my project target java8 and I don't want to go with maven toolchain just for that)

@Ekryd
Copy link
Owner

Ekryd commented Jun 18, 2022

Hi! SortPom version 3.0.1 supports Java 8, but 3.1.0 and forward has Java 11 as minimum requirement. Oracle dropped the support for Java 8 on March 2022 and there are quite a few new features in 11 to use, so I discontinued the support for 8.
I usually try to follow the support plan from Oracle:
https://www.oracle.com/java/technologies/java-se-support-roadmap.html

@Ekryd Ekryd added the question label Jun 18, 2022
@sbernard31
Copy link
Author

Thx for the quick answer 🙏

Oracle dropped the support for Java 8 on March 2022

Yep but extended to December 2030.

I will maybe try the 3.0.1 version, hoping there is not blocking issue for me :)

@Ekryd
Copy link
Owner

Ekryd commented Jun 20, 2022

Don’t think there are any major features. You can check the version history section in the readme.
Btw, Is it company policy or something else that stops you from using later versions of Java? Personally, I am longing for java 17 at work (we are using 11 now)

@sbernard31
Copy link
Author

Btw, Is it company policy or something else that stops you from using later versions of Java?

The project for which I want to maybe add sortpom has Java8 as minimal version.
This is an open source library and so aiming to be reused.
Even if world is moving through more recent version of Java, still be compliant to java8 does not enforce user to move to more recent version of jdk just for us and also be java8 compliant allow us to be more easily used in Android world.
See https://stackoverflow.com/questions/69643374/which-java-version-should-i-use-to-create-a-library-usable-with-android?noredirect=1#comment123110733_69643374

For maven plugin dependency, I could build project with most recent version of java and use toolchain to compile but I don't really want to bring out the big guns just for that.

Personally, I am longing for java 17 at work (we are using 11 now)

Yep I understand, but as an open source library developer, I need to live in the past 😅 for user community.
One year ago, I was even stucked with java7 😬

@Ekryd
Copy link
Owner

Ekryd commented Jun 22, 2022

That is food for thought. Maybe I will reevaluate the Java 11 for this plugin. Perhaps I have some time this summer to see how much work it is. Thanks for the input!

@Ekryd
Copy link
Owner

Ekryd commented Jun 22, 2022

@sbernard31
Copy link
Author

Hmmm, first glance doesn't look promising: https://stackoverflow.com/questions/54447541/how-to-write-code-in-java-11-but-target-java-8-and-above

That's why I said : "as an open source library developer, I need to live in the past" 🙂

@Ekryd
Copy link
Owner

Ekryd commented Jul 7, 2022

I experimented a bit with java 8:

  • reverted a few usages of var
  • fmt plugin didn't want to work with java 8, can be fixed with Maven profiles
  • The new version of dom4j dependency needs 11 or higher. This replaced the old version of JDom 1 which had a security vulnerability that couldn't be fixed.

In order to fix the vulnerability, I had to upgrade to java 11. Sorry to say that this is the end of the road.

@sbernard31
Copy link
Author

sbernard31 commented Jul 8, 2022

In order to fix the vulnerability, I had to upgrade to java 11. Sorry to say that this is the end of the road.

Thx for giving it a try 🙏 !

About :

The new version of dom4j dependency needs 11 or higher. This replaced the old version of JDom 1 which had a security vulnerability that couldn't be fixed.

Does it means that dom4j site web must be updated ? (it says Java 8)
(or maybe this not expected that domj4 need java 11 🤔)

@Ekryd Ekryd closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants