This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 786255 - modules/plugins/jmx/pom.xml cannot build on MacOS - wrong path to tools.jar
modules/plugins/jmx/pom.xml cannot build on MacOS - wrong path to tools.jar
Status: CLOSED DUPLICATE of bug 703557
Product: RHQ Project
Classification: Other
Component: Build System (Show other bugs)
4.3
Unspecified Mac OS
medium Severity unspecified (vote)
: ---
: RHQ 4.3.0
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks: jon310-sprint11/rhq44-sprint11
  Show dependency treegraph
 
Reported: 2012-01-31 15:36 EST by Elias Ross
Modified: 2012-02-06 13:33 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-06 13:33:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Elias Ross 2012-01-31 15:36:47 EST
[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 14:41:48 EST
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 12:02:35 EST
per bz triage (asantos, ccrouch, mfoley. loleary)
Comment 3 Elias Ross 2012-02-06 13:33:07 EST
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.