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

[OPENJDK-2269] Updates to support OpenJDK-21 execution. #3

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

sefroberg
Copy link
Collaborator

The main change that needed to happen was some post processing of the maven project generation because it defaults to JDK 7 and that is no longer supported in JDK 21.

@sefroberg sefroberg self-assigned this Nov 9, 2023
@@ -342,7 +342,7 @@ function mavenCreateAndRun() {
# collections dont like multiline
runOnBaseDirBash "`sclEnable` mvn -B archetype:generate -DgroupId=org.test.rhimg -DartifactId=rhimg -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false && cd rhimg && `sclEnable` mvn -B clean install && `sclEnable` java -cp target/rhimg-1.0-SNAPSHOT.jar org.test.rhimg.App"
else
runOnBaseDirBash "mvn -B archetype:generate -DgroupId=org.test.rhimg -DartifactId=rhimg -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false && cd rhimg && mvn -B clean install && java -cp target/rhimg-1.0-SNAPSHOT.jar org.test.rhimg.App"
runOnBaseDirBash "mvn -B archetype:generate -DgroupId=org.test.rhimg -DartifactId=rhimg -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false && cd rhimg && sed -i 's;<maven.compiler.source>1.7</maven.compiler.source>;<maven.compiler.source>1.8</maven.compiler.source>;g' pom.xml && sed -i 's;<maven.compiler.target>1.7</maven.compiler.target>;<maven.compiler.target>1.8</maven.compiler.target>;g' pom.xml && mvn -B clean install && java -cp target/rhimg-1.0-SNAPSHOT.jar org.test.rhimg.App"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I htink the sed is not necessary. the only think to update is -DarchetypeVersion to something newer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I spent two days looking the newest is 1.4 that defaults to jdk 1.7. It has not been updated since around 2019

# Need to modify this generated pom file for a maven.compiler.source & target to be 1.8 rather than 1.7.
pushd rhimg
sed -i "s;<maven.compiler.source>1.7</maven.compiler.source>;<maven.compiler.source>1.8</maven.compiler.source>;g" pom.xml
sed -i "s;<maven.compiler.target>1.7</maven.compiler.target>;<maven.compiler.target>1.8</maven.compiler.target>;g" pom.xml
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, the -DarchetypeVersion=1.4 bumped to neer should be all, with small detail, that there is no new archetype of maven-archetype-quickstart ... SO the way should be to update it. But I can guess why you are ot up to it. Maybe @mkoncek knows?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same as above. 1.4 is the latest

Copy link

Choose a reason for hiding this comment

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

I barely remember us having problems with archetype...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

hm..jsut tried and

mvn -B archetype:generate -DgroupId=org.test.rhimg  -DartifactId=rhimg -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false  -DjavaCompilerVersion=11

and it did NOT did the job

Copy link
Collaborator

Choose a reason for hiding this comment

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

@judovana
Copy link
Collaborator

judovana commented Nov 9, 2023

so yah, while there is no new archetype, not much else to do... I do not knwo a way how to control bytecode versions for aven-archetype-quickstart

judovana

This comment was marked as off-topic.

@sefroberg sefroberg merged commit 7a0008b into main Nov 9, 2023
@sefroberg sefroberg deleted the jdk21_update branch November 9, 2023 21:09
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.

4 participants