Merge branch '1.5.x' into 2.0.x

This commit is contained in:
Andy Wilkinson
2019-06-07 10:46:31 +01:00
2320 changed files with 23858 additions and 39476 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 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.
@@ -39,31 +39,28 @@ import org.springframework.context.annotation.Bean;
public class ResourceHandlingApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(ResourceHandlingApplication.class)
.properties("server.port:0")
new SpringApplicationBuilder(ResourceHandlingApplication.class).properties("server.port:0")
.listeners(new WebServerPortFileWriter("target/server.port")).run(args);
}
@Bean
public ServletRegistrationBean<?> resourceServletRegistration() {
ServletRegistrationBean<?> registration = new ServletRegistrationBean<HttpServlet>(
new HttpServlet() {
ServletRegistrationBean<?> registration = new ServletRegistrationBean<HttpServlet>(new HttpServlet() {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
URL resource = getServletContext()
.getResource(req.getQueryString());
if (resource == null) {
resp.sendError(404);
}
else {
resp.getWriter().println(resource);
resp.getWriter().flush();
}
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
URL resource = getServletContext().getResource(req.getQueryString());
if (resource == null) {
resp.sendError(404);
}
else {
resp.getWriter().println(resource);
resp.getWriter().flush();
}
}
});
});
registration.addUrlMappings("/servletContext");
return registration;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 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.
@@ -70,16 +70,14 @@ abstract class AbstractApplicationLauncher extends ExternalResource {
private Process startApplication() throws Exception {
File workingDirectory = getWorkingDirectory();
File serverPortFile = (workingDirectory != null)
? new File(workingDirectory, "target/server.port")
File serverPortFile = (workingDirectory != null) ? new File(workingDirectory, "target/server.port")
: new File("target/server.port");
serverPortFile.delete();
File archive = this.applicationBuilder.buildApplication();
List<String> arguments = new ArrayList<>();
arguments.add(System.getProperty("java.home") + "/bin/java");
arguments.addAll(getArguments(archive));
ProcessBuilder processBuilder = new ProcessBuilder(
StringUtils.toStringArray(arguments));
ProcessBuilder processBuilder = new ProcessBuilder(StringUtils.toStringArray(arguments));
if (workingDirectory != null) {
processBuilder.directory(workingDirectory);
}
@@ -94,16 +92,14 @@ abstract class AbstractApplicationLauncher extends ExternalResource {
long end = System.currentTimeMillis() + 30000;
while (serverPortFile.length() == 0) {
if (System.currentTimeMillis() > end) {
throw new IllegalStateException(
"server.port file was not written within 30 seconds");
throw new IllegalStateException("server.port file was not written within 30 seconds");
}
if (!process.isAlive()) {
throw new IllegalStateException("Application failed to launch");
}
Thread.sleep(100);
}
return Integer
.parseInt(FileCopyUtils.copyToString(new FileReader(serverPortFile)));
return Integer.parseInt(FileCopyUtils.copyToString(new FileReader(serverPortFile)));
}
private static class ConsoleCopy extends Thread {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 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.
@@ -65,15 +65,12 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests {
private static List<Object> createParameters(String packaging, String container,
List<Class<? extends AbstractApplicationLauncher>> applicationLaunchers) {
List<Object> parameters = new ArrayList<>();
ApplicationBuilder applicationBuilder = new ApplicationBuilder(temporaryFolder,
packaging, container);
ApplicationBuilder applicationBuilder = new ApplicationBuilder(temporaryFolder, packaging, container);
for (Class<? extends AbstractApplicationLauncher> launcherClass : applicationLaunchers) {
try {
AbstractApplicationLauncher launcher = launcherClass
.getDeclaredConstructor(ApplicationBuilder.class)
AbstractApplicationLauncher launcher = launcherClass.getDeclaredConstructor(ApplicationBuilder.class)
.newInstance(applicationBuilder);
String name = StringUtils.capitalize(container) + ": "
+ launcher.getDescription(packaging);
String name = StringUtils.capitalize(container) + ": " + launcher.getDescription(packaging);
parameters.add(new Object[] { name, launcher });
}
catch (Exception ex) {
@@ -83,8 +80,7 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests {
return parameters;
}
protected AbstractEmbeddedServletContainerIntegrationTests(String name,
AbstractApplicationLauncher launcher) {
protected AbstractEmbeddedServletContainerIntegrationTests(String name, AbstractApplicationLauncher launcher) {
this.launcher = launcher;
this.rest.setErrorHandler(new ResponseErrorHandler() {
@@ -103,14 +99,12 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests {
@Override
public URI expand(String uriTemplate, Object... uriVariables) {
return URI.create(
"http://localhost:" + launcher.getHttpPort() + uriTemplate);
return URI.create("http://localhost:" + launcher.getHttpPort() + uriTemplate);
}
@Override
public URI expand(String uriTemplate, Map<String, ?> uriVariables) {
return URI.create(
"http://localhost:" + launcher.getHttpPort() + uriTemplate);
return URI.create("http://localhost:" + launcher.getHttpPort() + uriTemplate);
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 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.
@@ -68,8 +68,7 @@ class ApplicationBuilder {
return doBuildApplication(containerFolder);
}
private File doBuildApplication(File containerFolder)
throws IOException, MavenInvocationException {
private File doBuildApplication(File containerFolder) throws IOException, MavenInvocationException {
File resourcesJar = createResourcesJar();
File appFolder = new File(containerFolder, "app");
appFolder.mkdirs();
@@ -85,12 +84,10 @@ class ApplicationBuilder {
if (resourcesJar.exists()) {
return resourcesJar;
}
try (JarOutputStream resourcesJarStream = new JarOutputStream(
new FileOutputStream(resourcesJar))) {
try (JarOutputStream resourcesJarStream = new JarOutputStream(new FileOutputStream(resourcesJar))) {
resourcesJarStream.putNextEntry(new ZipEntry("META-INF/resources/"));
resourcesJarStream.closeEntry();
resourcesJarStream.putNextEntry(
new ZipEntry("META-INF/resources/nested-meta-inf-resource.txt"));
resourcesJarStream.putNextEntry(new ZipEntry("META-INF/resources/nested-meta-inf-resource.txt"));
resourcesJarStream.write("nested".getBytes());
resourcesJarStream.closeEntry();
return resourcesJar;
@@ -104,10 +101,8 @@ class ApplicationBuilder {
context.put("bootVersion", Versions.getBootVersion());
context.put("resourcesJarPath", resourcesJar.getAbsolutePath());
try (FileWriter out = new FileWriter(new File(appFolder, "pom.xml"));
FileReader templateReader = new FileReader(
"src/test/resources/pom-template.xml")) {
Mustache.compiler().escapeHTML(false).compile(templateReader).execute(context,
out);
FileReader templateReader = new FileReader("src/test/resources/pom-template.xml")) {
Mustache.compiler().escapeHTML(false).compile(templateReader).execute(context, out);
}
}
@@ -120,10 +115,8 @@ class ApplicationBuilder {
context.put("repository", repository);
File settingsXml = new File(appFolder, "settings.xml");
try (FileWriter out = new FileWriter(settingsXml);
FileReader templateReader = new FileReader(
"src/test/resources/settings-template.xml")) {
Mustache.compiler().escapeHTML(false).compile(templateReader).execute(context,
out);
FileReader templateReader = new FileReader("src/test/resources/settings-template.xml")) {
Mustache.compiler().escapeHTML(false).compile(templateReader).execute(context, out);
}
return settingsXml;
}
@@ -131,19 +124,16 @@ class ApplicationBuilder {
private void copyApplicationSource(File appFolder) throws IOException {
File examplePackage = new File(appFolder, "src/main/java/com/example");
examplePackage.mkdirs();
FileCopyUtils.copy(
new File("src/test/java/com/example/ResourceHandlingApplication.java"),
FileCopyUtils.copy(new File("src/test/java/com/example/ResourceHandlingApplication.java"),
new File(examplePackage, "ResourceHandlingApplication.java"));
if ("war".equals(this.packaging)) {
File srcMainWebapp = new File(appFolder, "src/main/webapp");
srcMainWebapp.mkdirs();
FileCopyUtils.copy("webapp resource",
new FileWriter(new File(srcMainWebapp, "webapp-resource.txt")));
FileCopyUtils.copy("webapp resource", new FileWriter(new File(srcMainWebapp, "webapp-resource.txt")));
}
}
private void packageApplication(File appFolder, File settingsXml)
throws MavenInvocationException {
private void packageApplication(File appFolder, File settingsXml) throws MavenInvocationException {
InvocationRequest invocation = new DefaultInvocationRequest();
invocation.setBaseDirectory(appFolder);
invocation.setGoals(Collections.singletonList("package"));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -61,9 +61,7 @@ class BootRunApplicationLauncher extends AbstractApplicationLauncher {
for (File dependency : dependencies.listFiles()) {
classpath.add(dependency.getAbsolutePath());
}
return Arrays.asList("-cp",
StringUtils.collectionToDelimitedString(classpath,
File.pathSeparator),
return Arrays.asList("-cp", StringUtils.collectionToDelimitedString(classpath, File.pathSeparator),
"com.example.ResourceHandlingApplication");
}
catch (IOException ex) {
@@ -107,13 +105,11 @@ class BootRunApplicationLauncher extends AbstractApplicationLauncher {
}
private String getClassesPath(File archive) {
return (archive.getName().endsWith(".jar") ? "BOOT-INF/classes"
: "WEB-INF/classes");
return (archive.getName().endsWith(".jar") ? "BOOT-INF/classes" : "WEB-INF/classes");
}
private List<String> getLibPaths(File archive) {
return (archive.getName().endsWith(".jar")
? Collections.singletonList("BOOT-INF/lib")
return (archive.getName().endsWith(".jar") ? Collections.singletonList("BOOT-INF/lib")
: Arrays.asList("WEB-INF/lib", "WEB-INF/lib-provided"));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -40,26 +40,24 @@ public class EmbeddedServletContainerJarDevelopmentIntegrationTests
@Parameters(name = "{0}")
public static Object[] parameters() {
return AbstractEmbeddedServletContainerIntegrationTests.parameters("jar", Arrays
.asList(BootRunApplicationLauncher.class, IdeApplicationLauncher.class));
return AbstractEmbeddedServletContainerIntegrationTests.parameters("jar",
Arrays.asList(BootRunApplicationLauncher.class, IdeApplicationLauncher.class));
}
public EmbeddedServletContainerJarDevelopmentIntegrationTests(String name,
AbstractApplicationLauncher launcher) {
public EmbeddedServletContainerJarDevelopmentIntegrationTests(String name, AbstractApplicationLauncher launcher) {
super(name, launcher);
}
@Test
public void metaInfResourceFromDependencyIsAvailableViaHttp() {
ResponseEntity<String> entity = this.rest
.getForEntity("/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/nested-meta-inf-resource.txt", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void metaInfResourceFromDependencyIsAvailableViaServletContext() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/servletContext?/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/servletContext?/nested-meta-inf-resource.txt",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -41,48 +41,43 @@ public class EmbeddedServletContainerJarPackagingIntegrationTests
@Parameters(name = "{0}")
public static Object[] parameters() {
return AbstractEmbeddedServletContainerIntegrationTests.parameters("jar",
Arrays.asList(PackagedApplicationLauncher.class,
ExplodedApplicationLauncher.class));
Arrays.asList(PackagedApplicationLauncher.class, ExplodedApplicationLauncher.class));
}
public EmbeddedServletContainerJarPackagingIntegrationTests(String name,
AbstractApplicationLauncher launcher) {
public EmbeddedServletContainerJarPackagingIntegrationTests(String name, AbstractApplicationLauncher launcher) {
super(name, launcher);
}
@Test
public void nestedMetaInfResourceIsAvailableViaHttp() {
ResponseEntity<String> entity = this.rest
.getForEntity("/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/nested-meta-inf-resource.txt", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void nestedMetaInfResourceIsAvailableViaServletContext() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/servletContext?/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/servletContext?/nested-meta-inf-resource.txt",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void nestedJarIsNotAvailableViaHttp() {
ResponseEntity<String> entity = this.rest
.getForEntity("/BOOT-INF/lib/resources-1.0.jar", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/BOOT-INF/lib/resources-1.0.jar", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}
@Test
public void applicationClassesAreNotAvailableViaHttp() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/BOOT-INF/classes/com/example/ResourceHandlingApplication.class",
String.class);
ResponseEntity<String> entity = this.rest
.getForEntity("/BOOT-INF/classes/com/example/ResourceHandlingApplication.class", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}
@Test
public void launcherIsNotAvailableViaHttp() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/org/springframework/boot/loader/Launcher.class", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/org/springframework/boot/loader/Launcher.class",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -40,33 +40,30 @@ public class EmbeddedServletContainerWarDevelopmentIntegrationTests
@Parameters(name = "{0}")
public static Object[] parameters() {
return AbstractEmbeddedServletContainerIntegrationTests.parameters("war", Arrays
.asList(BootRunApplicationLauncher.class, IdeApplicationLauncher.class));
return AbstractEmbeddedServletContainerIntegrationTests.parameters("war",
Arrays.asList(BootRunApplicationLauncher.class, IdeApplicationLauncher.class));
}
public EmbeddedServletContainerWarDevelopmentIntegrationTests(String name,
AbstractApplicationLauncher launcher) {
public EmbeddedServletContainerWarDevelopmentIntegrationTests(String name, AbstractApplicationLauncher launcher) {
super(name, launcher);
}
@Test
public void metaInfResourceFromDependencyIsAvailableViaHttp() {
ResponseEntity<String> entity = this.rest
.getForEntity("/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/nested-meta-inf-resource.txt", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void metaInfResourceFromDependencyIsAvailableViaServletContext() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/servletContext?/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/servletContext?/nested-meta-inf-resource.txt",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void webappResourcesAreAvailableViaHttp() {
ResponseEntity<String> entity = this.rest.getForEntity("/webapp-resource.txt",
String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/webapp-resource.txt", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -41,58 +41,51 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests
@Parameters(name = "{0}")
public static Object[] parameters() {
return AbstractEmbeddedServletContainerIntegrationTests.parameters("war",
Arrays.asList(PackagedApplicationLauncher.class,
ExplodedApplicationLauncher.class));
Arrays.asList(PackagedApplicationLauncher.class, ExplodedApplicationLauncher.class));
}
public EmbeddedServletContainerWarPackagingIntegrationTests(String name,
AbstractApplicationLauncher launcher) {
public EmbeddedServletContainerWarPackagingIntegrationTests(String name, AbstractApplicationLauncher launcher) {
super(name, launcher);
}
@Test
public void nestedMetaInfResourceIsAvailableViaHttp() {
ResponseEntity<String> entity = this.rest
.getForEntity("/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/nested-meta-inf-resource.txt", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void nestedMetaInfResourceIsAvailableViaServletContext() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/servletContext?/nested-meta-inf-resource.txt", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/servletContext?/nested-meta-inf-resource.txt",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void nestedJarIsNotAvailableViaHttp() {
ResponseEntity<String> entity = this.rest
.getForEntity("/WEB-INF/lib/resources-1.0.jar", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/WEB-INF/lib/resources-1.0.jar", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}
@Test
public void applicationClassesAreNotAvailableViaHttp() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/WEB-INF/classes/com/example/ResourceHandlingApplication.class",
String.class);
ResponseEntity<String> entity = this.rest
.getForEntity("/WEB-INF/classes/com/example/ResourceHandlingApplication.class", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}
@Test
public void webappResourcesAreAvailableViaHttp() {
ResponseEntity<String> entity = this.rest.getForEntity("/webapp-resource.txt",
String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/webapp-resource.txt", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void loaderClassesAreNotAvailableViaHttp() {
ResponseEntity<String> entity = this.rest.getForEntity(
"/org/springframework/boot/loader/Launcher.class", String.class);
ResponseEntity<String> entity = this.rest.getForEntity("/org/springframework/boot/loader/Launcher.class",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
entity = this.rest.getForEntity(
"/org/springframework/../springframework/boot/loader/Launcher.class",
entity = this.rest.getForEntity("/org/springframework/../springframework/boot/loader/Launcher.class",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -54,8 +54,7 @@ class ExplodedApplicationLauncher extends AbstractApplicationLauncher {
@Override
protected List<String> getArguments(File archive) {
String mainClass = (archive.getName().endsWith(".war")
? "org.springframework.boot.loader.WarLauncher"
String mainClass = (archive.getName().endsWith(".war") ? "org.springframework.boot.loader.WarLauncher"
: "org.springframework.boot.loader.JarLauncher");
try {
explodeArchive(archive);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 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.
@@ -73,9 +73,7 @@ class IdeApplicationLauncher extends AbstractApplicationLauncher {
classpath.add(dependency.getAbsolutePath());
}
classpath.add(resourcesProject.getAbsolutePath());
return Arrays.asList("-cp",
StringUtils.collectionToDelimitedString(classpath,
File.pathSeparator),
return Arrays.asList("-cp", StringUtils.collectionToDelimitedString(classpath, File.pathSeparator),
"com.example.ResourceHandlingApplication");
}
catch (IOException ex) {
@@ -107,8 +105,7 @@ class IdeApplicationLauncher extends AbstractApplicationLauncher {
}
private File explodedResourcesProject(File dependencies) throws IOException {
File resourcesProject = new File(this.exploded,
"resources-project/target/classes");
File resourcesProject = new File(this.exploded, "resources-project/target/classes");
File resourcesJar = new File(dependencies, "resources-1.0.jar");
explodeArchive(resourcesJar, resourcesProject);
resourcesJar.delete();
@@ -128,13 +125,11 @@ class IdeApplicationLauncher extends AbstractApplicationLauncher {
}
private String getClassesPath(File archive) {
return (archive.getName().endsWith(".jar") ? "BOOT-INF/classes"
: "WEB-INF/classes");
return (archive.getName().endsWith(".jar") ? "BOOT-INF/classes" : "WEB-INF/classes");
}
private List<String> getLibPaths(File archive) {
return (archive.getName().endsWith(".jar")
? Collections.singletonList("BOOT-INF/lib")
return (archive.getName().endsWith(".jar") ? Collections.singletonList("BOOT-INF/lib")
: Arrays.asList("WEB-INF/lib", "WEB-INF/lib-provided"));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 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.
@@ -40,11 +40,9 @@ final class Versions {
public static String getBootVersion() {
String baseDir = StringUtils.cleanPath(new File(".").getAbsolutePath());
String mainBaseDir = evaluateExpression("pom.xml",
PROPERTIES + "/*[local-name()='main.basedir']/text()");
String mainBaseDir = evaluateExpression("pom.xml", PROPERTIES + "/*[local-name()='main.basedir']/text()");
mainBaseDir = mainBaseDir.replace("${basedir}", baseDir);
return evaluateExpression(mainBaseDir + "/pom.xml",
PROPERTIES + "/*[local-name()='revision']/text()");
return evaluateExpression(mainBaseDir + "/pom.xml", PROPERTIES + "/*[local-name()='revision']/text()");
}
private static String evaluateExpression(String file, String expression) {