Skip to content

Commit

Permalink
Merge branch '3.2.x'
Browse files Browse the repository at this point in the history
Closes gh-40465
  • Loading branch information
wilkinsona committed Apr 22, 2024
2 parents 3725d70 + deffda4 commit eb23d3c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -179,7 +179,7 @@ private TaskProvider<BootJar> configureBootJarTask(Project project,
.provider(() -> (String) bootJar.getManifest().getAttributes().get("Start-Class"));
bootJar.getMainClass()
.convention(resolveMainClassName.flatMap((resolver) -> manifestStartClass.isPresent()
? manifestStartClass : resolveMainClassName.get().readMainClassName()));
? manifestStartClass : resolver.readMainClassName()));
bootJar.getTargetJavaVersion()
.set(project.provider(() -> javaPluginExtension(project).getTargetCompatibility()));
bootJar.resolvedArtifacts(runtimeClasspath.getIncoming().getArtifacts().getResolvedArtifacts());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -153,9 +153,8 @@ Provider<String> readMainClassName() {
String classpath = getClasspath().filter(File::isDirectory)
.getFiles()
.stream()
.map((directory) -> getProject().getProjectDir().toPath().relativize(directory.toPath()))
.map(Path::toString)
.collect(Collectors.joining(","));
.map(File::getAbsolutePath)
.collect(Collectors.joining(File.pathSeparator));
return this.outputFile.map(new ClassNameReader(classpath));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -99,7 +99,7 @@ private TaskProvider<BootWar> configureBootWarTask(Project project) {
.provider(() -> (String) bootWar.getManifest().getAttributes().get("Start-Class"));
bootWar.getMainClass()
.convention(resolveMainClassName.flatMap((resolver) -> manifestStartClass.isPresent()
? manifestStartClass : resolveMainClassName.get().readMainClassName()));
? manifestStartClass : resolver.readMainClassName()));
bootWar.getTargetJavaVersion()
.set(project.provider(() -> javaPluginExtension(project).getTargetCompatibility()));
bootWar.resolvedArtifacts(runtimeClasspath.getIncoming().getArtifacts().getResolvedArtifacts());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -113,7 +113,7 @@ void failsGracefullyWhenNoTestMainMethodIsFound() throws IOException {
else {
assertThat(result.getOutput())
.contains("Main class name has not been configured and it could not be resolved from classpath "
+ String.join(File.separator, "build", "classes", "java", "test"));
+ canonicalPathOf("build/classes/java/test"));
}
}

Expand Down

0 comments on commit eb23d3c

Please sign in to comment.