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

SHRINKRES-295 add testing on Java 11 to support JDK's with java module system #146

Closed
wants to merge 9 commits into from

Conversation

maxandersen
Copy link
Contributor

@maxandersen maxandersen commented Jan 27, 2020

this is adding Java 11 testing to the test matrix but it really is about making resolver test suite work on Java 9 and up where java module system was introduced.

@bartoszmajsak
Copy link
Contributor

Thanks @maxandersen. It seems there's some work needed to make it working with JDK 11 though:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:jar (attach-javadocs) on project shrinkwrap-resolver-api: MavenReportException: Error while generating Javadoc: 
[ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/7/docs/api/ are in the unnamed module.
[ERROR] /home/travis/build/shrinkwrap/resolver/api/src/main/java/org/jboss/shrinkwrap/resolver/api/InvalidConfigurationFileException.java:38: warning - Tag @inheritDoc cannot be used in constructor documentation.  It can only be used in the following types of documentation: class/interface, method, inline text.
[ERROR] /home/travis/build/shrinkwrap/resolver/api/src/main/java/org/jboss/shrinkwrap/resolver/api/InvalidConfigurationFileException.java:43: warning - @inheritDoc used but InvalidConfigurationFileException(String, Throwable) does not override or implement any method.
[ERROR] /home/travis/build/shrinkwrap/resolver/api/src/main/java/org/jboss/shrinkwrap/resolver/api/InvalidConfigurationFileException.java:38: warning - Tag @inheritDoc cannot be used in constructor documentation.  It can only be used in the following types of documentation: class/interface, method, inline text.
[ERROR] /home/travis/build/shrinkwrap/resolver/api/src/main/java/org/jboss/shrinkwrap/resolver/api/InvalidConfigurationFileException.java:43: warning - @inheritDoc used but InvalidConfigurationFileException(String, Throwable) does not override or implement any method.
[ERROR] /home/travis/build/shrinkwrap/resolver/api/src/main/java/org/jboss/shrinkwrap/resolver/api/InvalidConfigurationFileException.java:38: warning - Tag @inheritDoc cannot be used in constructor documentation.  It can only be used in the following types of documentation: class/interface, method, inline text.
[ERROR] /home/travis/build/shrinkwrap/resolver/api/src/main/java/org/jboss/shrinkwrap/resolver/api/InvalidConfigurationFileException.java:38: warning - Tag @inheritDoc cannot be used in constructor documentation.  It can only be used in the following types of documentation: class/interface, method, inline text.
[ERROR] /home/travis/build/shrinkwrap/resolver/api/src/main/java/org/jboss/shrinkwrap/resolver/api/InvalidConfigurationFileException.java:43: warning - @inheritDoc used but InvalidConfigurationFileException(String, Throwable) does not override or implement any method.
[ERROR] 
[ERROR] Command line was: /home/travis/openjdk11/bin/javadoc @options @packages
[ERROR] 
[ERROR] Refer to the generated Javadoc files in '/home/travis/build/shrinkwrap/resolver/api/target/apidocs' dir.

see: https://travis-ci.org/shrinkwrap/resolver/jobs/642366263#L2920-L2932

@maxandersen
Copy link
Contributor Author

yeah, but at least looks like a javadoc issue not a core functional issue.

@famod
Copy link
Contributor

famod commented Jan 27, 2020

To fix the "modules" error, you need to set the source parameter of the javadoc plugin to the source level of the compiler plugin (most likely 1.7).
I had to do that before in another repo: eirslett/frontend-maven-plugin#870

@maxandersen
Copy link
Contributor Author

To fix the "modules" error, you need to set the source parameter of the javadoc plugin to the source level of the compiler plugin (most likely 1.7).

thanks fixed it and pushed updated - building locally gets now much longer but bumps into what looks like some logic assuming the JDK running tetsts looks like a Java 6/7 install which seems weird ..but I guess just "leftovers"

@maxandersen
Copy link
Contributor Author

system scope test was dependent on pre-java 9 module system layout so updated test that dependent on it to choose appropriately based on java.version.

@maxandersen
Copy link
Contributor Author

Seems travis are failing due to maven repo issues not build issues.

But if running you'll see it bump into that ManifestTestCase are failing as it is relying on Java 5! source targets.

Can we move that forward ?

@maxandersen maxandersen changed the title SHRINKRES-295 add testing on Java 11 SHRINKRES-295 add testing on Java 11 to support JDK's with java module system Jan 28, 2020
@maxandersen
Copy link
Contributor Author

Turns out CompilerPluginConfiguration was using old defaults for compiler.source/compiler.target, i.e. 1.5 vs 1.6.

Why:

 * as we are using fairly old maven defaults (1.5/1.6) maven builds fails
   stating source/target versions are deprecated.

This change addreses the need by:

 * explicit set source and target in tests to 1.7 so it at least will work on
 Java 8-11.
since january 2020 maven central wont serve http;
oldest maven version using https by default is 3.6.3.
without this gradle fails to recognize Java version 10 and 11.
@maxandersen
Copy link
Contributor Author

added more upgrades and explicit setting of source/target as tests assumes 1.5/1.6 works - they don't anymore since Java 9+

all tests now pass on my local build.

@bartoszmajsak
Copy link
Contributor

With the Gradle tooling update brought in this PR we are not able to build and run tests on JDK 7 - that's the reason why Travis build failed right now.

Thus I wonder - should we still support Java 7? Besides the failing build, the catch is that we bring transitive dependency which won't work in such a setup.

Thoughts @maxandersen @famod?

@maxandersen
Copy link
Contributor Author

Ah - so my personal opinion is that Java 7 is not worth it for any new releases.
But I can see Java 7 builds were reenabled lately but I have no idea what the reasons were for that.

We could probably find a gradle version that could be used to work but source/target 1.7 is already deprecated so it will be gone in java 14.

+1 for just do Java 8 and up.

@bartoszmajsak
Copy link
Contributor

bartoszmajsak commented Jan 29, 2020

Shrinkwrap Core is still on JDK7, but there's a branch with JDK8 changes. I think if we decide to switch we should do both at once.

This decision will have an impact on Arquillian at some point too.

@petrberan
Copy link
Member

Closing this one as it is superseded by #198 . Shrinkwrap is already on JDK 8 and GHA, it also contains newer Maven version. But thank you both

@petrberan petrberan closed this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants