mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Previously, there were a number of inconsistencies in the embedded containers' handling of static resources. The Servlet spec requires that static resources can be served from the META-INF/resources/ directory of jars nested inside a war in WEB-INF/lib/. The intention was also to extend this to cover jar packaging when jars are nested in BOOT-INF/lib/. This worked when using Tomcat as long as Jasper was on the classpath. If you didn't have Jasper on the classpath or you were using Jetty or Undertow it did not work. This commit updates the configuration of embedded Jetty, Tomcat, and Undertow so that all three containers handle static resources in the same way, serving them from jars in WEB-INF/lib/ or /BOOT-INF/lib/. Numerous intergration tests have been added to verify the behaviour, including tests for Tomcat 8.0 and 7.0 which is supported in addition to the default 8.5.x. Note that static resource handling only works with Jetty 9.3.x and 9.2 and earlier does not support nested jars ( see https://github.com/eclipse/jetty.project/issues/518 for details). Closes gh-8299
112 lines
3.4 KiB
XML
112 lines
3.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<parent>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-parent</artifactId>
|
|
<version>1.4.5.BUILD-SNAPSHOT</version>
|
|
<relativePath>../spring-boot-parent</relativePath>
|
|
</parent>
|
|
<artifactId>spring-boot-integration-tests</artifactId>
|
|
<packaging>pom</packaging>
|
|
<name>Spring Boot Integration Tests</name>
|
|
<description>Spring Boot Integration Tests</description>
|
|
<url>http://projects.spring.io/spring-boot/</url>
|
|
<organization>
|
|
<name>Pivotal Software, Inc.</name>
|
|
<url>http://www.spring.io</url>
|
|
</organization>
|
|
<properties>
|
|
<main.basedir>${basedir}/..</main.basedir>
|
|
<java.version>1.8</java.version>
|
|
</properties>
|
|
<modules>
|
|
<module>spring-boot-devtools-tests</module>
|
|
<module>spring-boot-integration-tests-embedded-servlet-container</module>
|
|
<module>spring-boot-gradle-tests</module>
|
|
<module>spring-boot-launch-script-tests</module>
|
|
<module>spring-boot-security-tests</module>
|
|
</modules>
|
|
<profiles>
|
|
<profile>
|
|
<id>default</id>
|
|
<activation>
|
|
<activeByDefault>true</activeByDefault>
|
|
</activation>
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<!-- Invoke integration tests in the install phase, after the maven-plugin
|
|
is available -->
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-invoker-plugin</artifactId>
|
|
<inherited>false</inherited>
|
|
<configuration>
|
|
<settingsFile>src/it/settings.xml</settingsFile>
|
|
<projectsDirectory>${main.basedir}/spring-boot-samples/</projectsDirectory>
|
|
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
|
|
<skipInvocation>${skipTests}</skipInvocation>
|
|
<streamLogs>true</streamLogs>
|
|
<profiles>
|
|
<profile>integration-test</profile>
|
|
</profiles>
|
|
<localRepositoryPath> </localRepositoryPath>
|
|
<pomIncludes>
|
|
<pomInclude>*/pom.xml</pomInclude>
|
|
</pomIncludes>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<id>integration-test</id>
|
|
<phase>install</phase>
|
|
<goals>
|
|
<goal>install</goal>
|
|
<goal>run</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
<inherited>false</inherited>
|
|
<executions>
|
|
<execution>
|
|
<id>clean-samples</id>
|
|
<phase>clean</phase>
|
|
<goals>
|
|
<goal>run</goal>
|
|
</goals>
|
|
<configuration>
|
|
<target>
|
|
<delete includeemptydirs="true">
|
|
<fileset dir="${main.basedir}/spring-boot-samples" includes="**/target/" />
|
|
</delete>
|
|
</target>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-clean-plugin</artifactId>
|
|
<inherited>false</inherited>
|
|
<executions>
|
|
<execution>
|
|
<id>clean-samples</id>
|
|
<phase>clean</phase>
|
|
<goals>
|
|
<goal>clean</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</profile>
|
|
<profile>
|
|
<id>full</id>
|
|
</profile>
|
|
</profiles>
|
|
</project>
|