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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions containersQa/testlib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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

fi
}

Expand Down Expand Up @@ -570,6 +570,13 @@ function s2iBasic() {
local d=`mktemp -d`
pushd $d
mvn -B archetype:generate -DgroupId=org.test.rhimg -DartifactId=rhimg -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
# 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.

echo "Print the pom.xml file."
cat pom.xml
popd
git config --global user.name "conatinerQa bot"
git config --global user.email "[email protected]"
git init --bare rhimgrepo
Expand Down Expand Up @@ -699,14 +706,15 @@ function checkHardcodedJdks() {
JRE_8_VERSION='1.8.0_392-b08'
JRE_11_VERSION='11.0.21+9-LTS'
JRE_17_VERSION='17.0.9+9-LTS'
JRE_21_VERSION='21.0.1+12-LTS'
cat $(getOldJavaVersionLog)
cat $(getOldJavaVersionLog) | grep "openjdk version"
cat $(getOldJavaVersionLog) | grep -e "$JRE_11_VERSION" -e "$JRE_8_VERSION" -e "$JRE_17_VERSION"
cat $(getOldJavaVersionLog) | grep -e "$JRE_11_VERSION" -e "$JRE_8_VERSION" -e "$JRE_17_VERSION" -e "$JRE_21_VERSION"

else
cat $(getOldMvnVersionLog)
cat $(getOldMvnVersionLog) | grep "Java version:"
cat $(getOldMvnVersionLog) | grep -e "Java version: 11.0.21" -e "Java version: 1.8.0_392" -e "Java version: 17.0.9"
cat $(getOldMvnVersionLog) | grep -e "Java version: 11.0.21" -e "Java version: 1.8.0_392" -e "Java version: 17.0.9" -e "Java version: 21.0.1"
fi

}
Expand All @@ -720,6 +728,8 @@ function checkJdkMajorVersion() {
VERSION_CHECK_KEY='openjdk version \"1.8'
elif [[ $OTOOL_JDK_VERSION -eq 17 ]]; then
VERSION_CHECK_KEY='openjdk version \"17.0'
elif [[ $OTOOL_JDK_VERSION -eq 21 ]]; then
VERSION_CHECK_KEY='openjdk version \"21.0'
else
echo "Environment variable 'OTOOL_JDK_VERSION' not accepted. Please Debug."
VERSION_CHECK_KEY='-1'
Expand Down