Skip to content

Commit

Permalink
Merge pull request quarkusio#38344 from geoand/jdk17-cleanup
Browse files Browse the repository at this point in the history
Apply some more cleanup now that baseline is JDK 17
  • Loading branch information
geoand authored Jan 23, 2024
2 parents 8f28ff5 + 431e920 commit 6a3e24e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ public JavaVersion getJavaVersion() {

public interface JavaVersion {

@Deprecated(forRemoval = true)
Status isExactlyJava11();

@Deprecated(forRemoval = true)
Status isJava11OrHigher();

@Deprecated(forRemoval = true)
Status isJava17OrHigher();

Status isJava21OrHigher();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,10 @@ public void build(Optional<AppCDSRequestedBuildItem> appCDsRequested,
}
}

boolean useArchiveClassesAtExit = compiledJavaVersion.getJavaVersion()
.isJava17OrHigher() == CompiledJavaVersionBuildItem.JavaVersion.Status.TRUE;

Path classesListPath = null;
if (!useArchiveClassesAtExit) {
classesListPath = createClassesList(jarResult, outputTarget, javaBinPath, containerImage,
appCDsRequested.get().getAppCDSDir(), packageConfig.isFastJar());
if (classesListPath == null) {
return;
}
log.debugf("'%s' successfully created.", CLASSES_LIST_FILE_NAME);
}

Path appCDSPath;
log.info("Launching AppCDS creation process.");
if (useArchiveClassesAtExit) {
appCDSPath = createAppCDSFromExit(jarResult, outputTarget, javaBinPath, containerImage,
packageConfig.isFastJar());
} else {
appCDSPath = createAppCDSFromClassesList(jarResult, outputTarget, javaBinPath, containerImage, classesListPath,
packageConfig.isFastJar());
}
appCDSPath = createAppCDSFromExit(jarResult, outputTarget, javaBinPath, containerImage,
packageConfig.isFastJar());

if (appCDSPath == null) {
log.warn("Unable to create AppCDS.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ public void dockerBuildFromJar(DockerConfig dockerConfig,
Optional<DockerFileBaseInformationProvider.DockerFileBaseInformation> dockerFileBaseInformation = dockerFileBaseInformationProvider
.determine(dockerfilePaths.getDockerfilePath());

if ((compiledJavaVersion.getJavaVersion().isJava17OrHigher() == CompiledJavaVersionBuildItem.JavaVersion.Status.TRUE)
&& dockerFileBaseInformation.isPresent() && (dockerFileBaseInformation.get().getJavaVersion() < 17)) {
if (dockerFileBaseInformation.isPresent() && (dockerFileBaseInformation.get().getJavaVersion() < 17)) {
throw new IllegalStateException(
String.format(
"The project is built with Java 17 or higher, but the selected Dockerfile (%s) is using a lower Java version in the base image (%s). Please ensure you are using the proper base image in the Dockerfile.",
Expand Down

0 comments on commit 6a3e24e

Please sign in to comment.