Bug 786255 - modules/plugins/jmx/pom.xml cannot build on MacOS - wrong path to tools.jar
Summary: modules/plugins/jmx/pom.xml cannot build on MacOS - wrong path to tools.jar
Keywords:
Status: CLOSED DUPLICATE of bug 703557
Alias: None
Product: RHQ Project
Classification: Other
Component: Build System
Version: 4.3
Hardware: Unspecified
OS: Mac OS
medium
unspecified
Target Milestone: ---
: RHQ 4.3.0
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon310-sprint11, rhq44-sprint11
TreeView+ depends on / blocked
 
Reported: 2012-01-31 20:36 UTC by Elias Ross
Modified: 2012-02-06 18:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-06 18:33:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Elias Ross 2012-01-31 20:36:47 UTC
[ERROR] Failed to execute goal on project rhq-jmx-plugin: Could not resolve dependencies for project org.rhq:rhq-jmx-plugin:jar:4.3.0-SNAPSHOT: Could not find artifact com.sun:tools:jar:1.6.0 at specified path /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../lib/tools.jar -> [Help 1]

Pom has:

      <dependency>
         <groupId>com.sun</groupId>
         <artifactId>tools</artifactId>
         <version>1.6.0</version>
         <scope>system</scope>
         <systemPath>${java.home}/../lib/tools.jar</systemPath>
      </dependency>

See this solution: http://stackoverflow.com/questions/3080437/jdk-tools-jar-as-maven-dependency


This works on Mac OS X

diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 8780b32..714dc6a 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -30,7 +30,7 @@
          <artifactId>tools</artifactId>
          <version>1.6.0</version>
          <scope>system</scope>
-         <systemPath>${java.home}/../lib/tools.jar</systemPath>
+         <systemPath>${toolsjar}</systemPath>
       </dependency>
 
    </dependencies>
@@ -315,6 +315,30 @@
           </plugins>
        </build>
      </profile>
-   </profiles>
+        <profile>
+            <id>default-profile</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+                <file>
+                    <exists>${java.home}/../lib/tools.jar</exists>
+                </file>
+            </activation>
+            <properties>
+                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
+            </properties>
+        </profile>
+        <profile>
+            <id>mac-profile</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+                <file>
+                    <exists>${java.home}/../Classes/classes.jar</exists>
+                </file>
+            </activation>
+            <properties>
+                <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
+            </properties>
+        </profile>
+    </profiles>
 
 </project>

Comment 1 Ian Springer 2012-02-03 19:41:48 UTC
I'm confused as to why this is still not working. I checked in a fix to master a week or so ago that's similar to the one you're proposing. See https://bugzilla.redhat.com/show_bug.cgi?id=703557, comments 6-9. Can you shed any light?

Comment 2 Mike Foley 2012-02-06 17:02:35 UTC
per bz triage (asantos, ccrouch, mfoley. loleary)

Comment 3 Elias Ross 2012-02-06 18:33:07 UTC
master is working on Mac OS. I was working off an older branch off of master that still was broken.

*** This bug has been marked as a duplicate of bug 703557 ***


Note You need to log in before you can comment on or make changes to this bug.