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

[#519] Add moditect-generated module-info.java files and a simple IT. #722

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bmarwell
Copy link

@bmarwell bmarwell commented Apr 20, 2022

Fixes #519 (to be proven)

  • uses lots of more profiles.
  • requires Java 7+ for running (JRE7) as before)
  • requires Java 8+ for building a release (only Release, not runtime!),
  • requires Java 9+ for running the integration test
  • does not deploy integration tests
  • maven.compiler.release is set instead of source and target for Java9+
  • maven.compiler.source/target is now only set on Java7 and Java8 so the javadoc and sources plugin will work correctly.
  • To complicate things, release can only interpret "7" while target/source and groovy can only interpret "1.7" 😃
  • Does not contain ITs for neither GSON nor org.json.
  • Ugly workaround for the fact that the old bundle-plugin crashes on Java9+ module-info.java files,
    had to provide an empty static MANIFEST.MF file and disable the bundle-plugin on ITs.
    • Workaround: Put the configuration into the default execution instead so we can use another, custom execution for the ITs.
  • I found it odd that the extensions do not reference their correct parent pom as parent pom, instead the root is chosen.
    This is probably a maven anti-pattern and was corrected by khmarbaise for Shiro.
  • <parentLocation /> = ../pom.xml is redundant for /api and /impl, but did not bother to correct it here
  • some pom.xml files were missing a final line break as required by unix spec.

… IT.

- uses lots of more profiles
- requires Java 8+ for a release
- requires Java 9+ for running the integration test
- does not deploy integration tests
- maven.compiler.release is set instead of source and target for Java9+
- maven.compiler.source/target is now only set on Java7 and Java8 so the javadoc and sources plugin will work correctly.
- Does not contain ITs for neither GSON nor org.json.
- Ugly workaround for the fact that the old bundle-plugin crashes on Java9+ module-info.java files,
  had to provide an empty static MANIFEST.MF file and disable the bundle-plugin on ITs.
- I found it odd that the extensions do not reference their correct parent pom as parent pom, instead the root is chosen.
  This is probably a maven anti-pattern and was corrected by khmarbaise for Shiro.
- parentLocation = ../pom.xml is redundant for /api and /impl, but did not bother to correct it here
- some pom.xml files were missing a final line break as required by unix spec.
@bmarwell
Copy link
Author

Did a quick test:
./mvnw install on JDK 8, then ./mvnw verify -pl integration-tests/unsigned-jackson on JDK11 which passed.
This should probably be added to the CI.

@bmarwell bmarwell marked this pull request as ready for review April 20, 2022 10:37
@lhazlewood
Copy link
Contributor

Just a quick note, and this is probably obvious, but this can't be merged until after a 1.0 release due to the requirement for JDK 8.

@lhazlewood lhazlewood modified the milestones: 0.12.0, 1.0 Apr 20, 2022
@bmarwell
Copy link
Author

bmarwell commented Apr 20, 2022

@lhazlewood this only requires Java 8 at RELEASE time, not at runtime.

Are you sure this is what you intended to say? 🤔

Talked to @bdemers the other day about it. We were thinking of a release profile which included an enforcer check for JDK8.
That would produce JDK7 code in all cases.

I really don't see why this needs to go into the next major version and couldn't be included in 0.12.0.

@bmarwell
Copy link
Author

Also, you might just have read past my comments mentioning 1.7 profiles and you probably just forgot to start the CI jobs.
I'm positive it builds on all jobs including JDK7 (just without module-info.java).

@bmarwell
Copy link
Author

Oohhhh I see what you mean now.
I wrote "requires JDK8 for release".

But it's only for building a release with the moditect files included. It still is running on (read carefully): JRE 7!

I updated the description to emphasize the difference between a JDK and JRE and build time and runtime. Of course you know, but I put the blame on me not being a native speaker. 🙈

@bmarwell
Copy link
Author

Huh… I cannot get the CI to work.

Groovy is generating this class jjwt/impl/target/generated-sources/groovy-stubs/test/io/jsonwebtoken/impl/io/FakeServiceDescriptorClassLoader.java:

public class NoServiceDescriptorClassLoader
        extends java.lang.ClassLoader implements
        groovy.lang.GroovyObject {
    ;

    public NoServiceDescriptorClassLoader
            (java.lang.ClassLoader parent) {
        super((java.lang.String) null, (java.lang.ClassLoader) null);
    }
}

... oddly this fails on zulu-11 and temurin-11, but not on IBM Semeru-11.

This is the Semeru Constructor:

protected ClassLoader(String classLoaderName, ClassLoader parentLoader) {
	this(checkSecurityPermission(), classLoaderName, parentLoader);
}

This for Zulu/Temurin:

    protected ClassLoader(String name, ClassLoader parent) {
        this(checkCreateClassLoader(name), name, parent);
    }

Will dig into it later.

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.

Enable JDK9+ module-info
2 participants