Commit 8143d1f3 authored by Phillip Webb's avatar Phillip Webb

Apply animal sniffer to entire build

Move animal sniffer configuration out of spring-boot-dependencies to
spring-boot-parent and apply it to all projects.

See gh-716
parent 59692cd9
...@@ -201,12 +201,4 @@ ...@@ -201,12 +201,4 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> </project>
...@@ -1671,33 +1671,6 @@ ...@@ -1671,33 +1671,6 @@
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>2.5</version> <version>2.5</version>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.14</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16</artifactId>
<version>1.0</version>
</signature>
</configuration>
<executions>
<execution>
<id>enforce-java-6</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<annotations>
<annotation>org.springframework.lang.UsesJava8</annotation>
<annotation>org.springframework.lang.UsesJava7</annotation>
</annotations>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
......
...@@ -278,6 +278,11 @@ ...@@ -278,6 +278,11 @@
<artifactId>maven-site-plugin</artifactId> <artifactId>maven-site-plugin</artifactId>
<version>3.4</version> <version>3.4</version>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.14</version>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.cargo</groupId> <groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId> <artifactId>cargo-maven2-plugin</artifactId>
...@@ -492,6 +497,30 @@ ...@@ -492,6 +497,30 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16</artifactId>
<version>1.0</version>
</signature>
<annotations>
<annotation>org.springframework.lang.UsesJava8</annotation>
<annotation>org.springframework.lang.UsesJava7</annotation>
</annotations>
</configuration>
<executions>
<execution>
<id>enforce-java-6</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>
......
...@@ -128,6 +128,14 @@ ...@@ -128,6 +128,14 @@
</archive> </archive>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<!-- The use of SignalUtils seems to mess up animal sniffer -->
<skip>true</skip>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
</properties> </properties>
<dependencies> <dependencies>
<!-- Must never have compile/runtime time dependencies --> <!-- Must never have compile/runtime time dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId> <artifactId>jcl-over-slf4j</artifactId>
......
...@@ -27,6 +27,7 @@ import java.util.Enumeration; ...@@ -27,6 +27,7 @@ import java.util.Enumeration;
import org.springframework.boot.loader.jar.Handler; import org.springframework.boot.loader.jar.Handler;
import org.springframework.boot.loader.jar.JarFile; import org.springframework.boot.loader.jar.JarFile;
import org.springframework.lang.UsesJava7;
/** /**
* {@link ClassLoader} used by the {@link Launcher}. * {@link ClassLoader} used by the {@link Launcher}.
...@@ -224,6 +225,7 @@ public class LaunchedURLClassLoader extends URLClassLoader { ...@@ -224,6 +225,7 @@ public class LaunchedURLClassLoader extends URLClassLoader {
} }
} }
@UsesJava7
private static LockProvider setupLockProvider() { private static LockProvider setupLockProvider() {
try { try {
ClassLoader.registerAsParallelCapable(); ClassLoader.registerAsParallelCapable();
...@@ -248,6 +250,7 @@ public class LaunchedURLClassLoader extends URLClassLoader { ...@@ -248,6 +250,7 @@ public class LaunchedURLClassLoader extends URLClassLoader {
/** /**
* Java 7 specific {@link LockProvider}. * Java 7 specific {@link LockProvider}.
*/ */
@UsesJava7
private static class Java7LockProvider extends LockProvider { private static class Java7LockProvider extends LockProvider {
@Override @Override
......
...@@ -29,6 +29,7 @@ import javax.sql.XADataSource; ...@@ -29,6 +29,7 @@ import javax.sql.XADataSource;
import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.lang.UsesJava7;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import bitronix.tm.resource.common.ResourceBean; import bitronix.tm.resource.common.ResourceBean;
...@@ -110,6 +111,7 @@ public class PoolingDataSourceBean extends PoolingDataSource implements BeanName ...@@ -110,6 +111,7 @@ public class PoolingDataSourceBean extends PoolingDataSource implements BeanName
} }
@Override @Override
@UsesJava7
public Logger getParentLogger() throws SQLFeatureNotSupportedException { public Logger getParentLogger() throws SQLFeatureNotSupportedException {
try { try {
return ((DataSource) this).getParentLogger(); return ((DataSource) this).getParentLogger();
...@@ -166,6 +168,7 @@ public class PoolingDataSourceBean extends PoolingDataSource implements BeanName ...@@ -166,6 +168,7 @@ public class PoolingDataSourceBean extends PoolingDataSource implements BeanName
} }
@Override @Override
@UsesJava7
public Logger getParentLogger() throws SQLFeatureNotSupportedException { public Logger getParentLogger() throws SQLFeatureNotSupportedException {
return this.dataSource.getParentLogger(); return this.dataSource.getParentLogger();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment