Browse Source

Make Spring Boot work in Java 1.6 on Mac OS X

Currently Spring Boot fails in Java 1.6 on Mac OS X due to the
"tools.jar" being integrated into classes.jar in the Apple version of
Java 6.

Apple fixed this with Java 7, but we should still support Java 6. We had
to roll back to maven-plugin-plugin 3.1 to make this work with Java 6
and 7.

All tests pass with Java 6 and Java 7.
pull/508/head
Trevor Menagh 12 years ago committed by Dave Syer
parent
commit
b8c472007a
  1. 26
      spring-boot-tools/spring-boot-loader-tools/pom.xml
  2. 29
      spring-boot-tools/spring-boot-maven-plugin/pom.xml

26
spring-boot-tools/spring-boot-loader-tools/pom.xml

@ -11,6 +11,30 @@
<properties> <properties>
<main.basedir>${basedir}/../..</main.basedir> <main.basedir>${basedir}/../..</main.basedir>
</properties> </properties>
<profiles>
<profile>
<id>standard-jdk</id>
<activation>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../lib/tools.jar</tools-jar>
</properties>
</profile>
<profile>
<id>apple-jdk</id>
<activation>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../Classes/classes.jar</tools-jar>
</properties>
</profile>
</profiles>
<dependencies> <dependencies>
<!-- Compile --> <!-- Compile -->
<dependency> <dependency>
@ -18,7 +42,7 @@
<artifactId>tools</artifactId> <artifactId>tools</artifactId>
<version>${java.version}</version> <version>${java.version}</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath> <systemPath>${tools-jar}</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>

29
spring-boot-tools/spring-boot-maven-plugin/pom.xml

@ -12,6 +12,28 @@
<main.basedir>${basedir}/../..</main.basedir> <main.basedir>${basedir}/../..</main.basedir>
</properties> </properties>
<profiles> <profiles>
<profile>
<id>standard-jdk</id>
<activation>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../lib/tools.jar</tools-jar>
</properties>
</profile>
<profile>
<id>apple-jdk</id>
<activation>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../Classes/classes.jar</tools-jar>
</properties>
</profile>
<profile> <profile>
<id>integration</id> <id>integration</id>
<activation> <activation>
@ -46,6 +68,13 @@
</profiles> </profiles>
<dependencies> <dependencies>
<!-- Compile --> <!-- Compile -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${tools-jar}</systemPath>
</dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>spring-boot-loader-tools</artifactId> <artifactId>spring-boot-loader-tools</artifactId>

Loading…
Cancel
Save