Bladeren bron

Getting the example to compile on Mac OS X

Solution found at
http://mojo.10943.n7.nabble.com/ERROR-Could-not-find-artifact-com-sun-tools-jar-td41660.html

Without this change, the tutorial will not build with maven on a Mac.
Trevor Lalish-Menagh 10 jaren geleden
bovenliggende
commit
fab046c602
2 gewijzigde bestanden met toevoegingen van 68 en 0 verwijderingen
  1. 34
    0
      complete/pom.xml
  2. 34
    0
      initial/pom.xml

+ 34
- 0
complete/pom.xml Bestand weergeven

@@ -7,6 +7,31 @@
7 7
     <artifactId>gs-rest-service</artifactId>
8 8
     <version>0.1.0</version>
9 9
 
10
+    <profiles>
11
+        <profile>
12
+            <id>standard-jdk</id>
13
+            <activation>
14
+                <file>
15
+                    <exists>${java.home}/../lib/tools.jar</exists>
16
+                </file>
17
+            </activation>
18
+            <properties>
19
+                <tools-jar>${java.home}/../lib/tools.jar</tools-jar>
20
+            </properties>
21
+        </profile>
22
+        <profile>
23
+            <id>apple-jdk</id>
24
+            <activation>
25
+                <file>
26
+                    <exists>${java.home}/../Classes/classes.jar</exists>
27
+                </file>
28
+            </activation>
29
+            <properties>
30
+                <tools-jar>${java.home}/../Classes/classes.jar</tools-jar>
31
+            </properties>
32
+        </profile>
33
+    </profiles>
34
+
10 35
     <parent>
11 36
         <groupId>org.springframework.boot</groupId>
12 37
         <artifactId>spring-boot-starter-parent</artifactId>
@@ -37,6 +62,15 @@
37 62
             <plugin>
38 63
                 <groupId>org.springframework.boot</groupId>
39 64
                 <artifactId>spring-boot-maven-plugin</artifactId>
65
+                <dependencies>
66
+                    <dependency>
67
+                        <groupId>com.sun</groupId>
68
+                        <artifactId>tools</artifactId>
69
+                        <version>1.6</version>
70
+                        <scope>system</scope>
71
+                        <systemPath>${tools-jar}</systemPath>
72
+                    </dependency>
73
+                </dependencies>
40 74
             </plugin>
41 75
         </plugins>
42 76
     </build>

+ 34
- 0
initial/pom.xml Bestand weergeven

@@ -7,6 +7,31 @@
7 7
     <artifactId>gs-rest-service</artifactId>
8 8
     <version>0.1.0</version>
9 9
 
10
+    <profiles>
11
+        <profile>
12
+            <id>standard-jdk</id>
13
+            <activation>
14
+                <file>
15
+                    <exists>${java.home}/../lib/tools.jar</exists>
16
+                </file>
17
+            </activation>
18
+            <properties>
19
+                <tools-jar>${java.home}/../lib/tools.jar</tools-jar>
20
+            </properties>
21
+        </profile>
22
+        <profile>
23
+            <id>apple-jdk</id>
24
+            <activation>
25
+                <file>
26
+                    <exists>${java.home}/../Classes/classes.jar</exists>
27
+                </file>
28
+            </activation>
29
+            <properties>
30
+                <tools-jar>${java.home}/../Classes/classes.jar</tools-jar>
31
+            </properties>
32
+        </profile>
33
+    </profiles>
34
+
10 35
     <parent>
11 36
         <groupId>org.springframework.boot</groupId>
12 37
         <artifactId>spring-boot-starter-parent</artifactId>
@@ -37,6 +62,15 @@
37 62
             <plugin>
38 63
                 <groupId>org.springframework.boot</groupId>
39 64
                 <artifactId>spring-boot-maven-plugin</artifactId>
65
+                <dependencies>
66
+                    <dependency>
67
+                        <groupId>com.sun</groupId>
68
+                        <artifactId>tools</artifactId>
69
+                        <version>1.6</version>
70
+                        <scope>system</scope>
71
+                        <systemPath>${tools-jar}</systemPath>
72
+                    </dependency>
73
+                </dependencies>
40 74
             </plugin>
41 75
         </plugins>
42 76
     </build>