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

improve pom #477

Merged
merged 1 commit into from
Dec 31, 2023
Merged

improve pom #477

merged 1 commit into from
Dec 31, 2023

Conversation

oldratlee
Copy link
Contributor

@oldratlee oldratlee commented Dec 30, 2023

  • add inceptionYear element, and use it in copyright bottom
  • add missing version declaration for maven-gpg-plugin
    more stable build and fix related warning message
  • add maven-enforcer-plugin
    more straightforward build error message and fast-failed when maven/java version is not satisfied

- add `inceptionYear` element, and use it in `copyright bottom`
- add missing version declaration for `maven-gpg-plugin`
  more stable build and fix related warning message
- add `maven-enforcer-plugin`
  more straightforward error message when `maven`/`java` version is not satisfied
<version>3.2.5</version>
</requireMavenVersion>
<requireJavaVersion>
<version>11</version>
Copy link
Member

Choose a reason for hiding this comment

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

Is this consistent with the other parts? The binary is built by Java 8.

Copy link
Contributor Author

@oldratlee oldratlee Dec 31, 2023

Choose a reason for hiding this comment

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

Yes.

  • requireJavaVersion enforce the java version to run maven.
    • I found that compile failed with jdk 8 (and test target is 11).
    • Java 21 satisfies requireJavaVersion 11.
  • The bytecode version of binary is controlled by javac target option.

The guarantee that the built binary can be used by java 8 application, is important for foundational libraries(e.g. javassit).

The CI can check this guarantee with some works:

  • build/compile with java 21 or 11(e.g. maven install)
  • run test(without compile) on multiple java versions(e.g. mvn surfire:test)
  • the test cases that can not run by java 8, should be skipped conditionally(by test case/framework config).

I do this(build by java high version and run test by java low versions in CI/GitHub actions) in some projects, e.g. https://github.com/alibaba/transmittable-thread-local/actions/runs/7358077464/job/20030750510#step:7:206

I can try to add this to the CI/GitHub actions of javassist project with honor.

Copy link
Member

Choose a reason for hiding this comment

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

I found that compile failed with jdk 8 (and test target is 11).

This is correct. Some features are only for Java 11 and above.

@chibash chibash merged commit 7302b8b into jboss-javassist:master Dec 31, 2023
2 checks passed
@oldratlee oldratlee deleted the improve-pom branch January 1, 2024 14:19
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