-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
@@ -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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi! There is better way then that sed:
https://github.com/apache/maven-archetypes/blob/d605cb7cb756618db9ee22af2880c6d7bdde2537/maven-archetype-quickstart/src/main/resources-filtered/archetype-resources/pom.xml#L48
You should be able to pass -DjavaCompilerVersion=8 and be doen with that.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.