[jboss-as7-dev] Maven system dependencies

Kabir Khan kabir.khan at jboss.com
Wed Apr 4 08:30:14 EDT 2012


Recently there have been a few pull requests using system dependencies, which work on Windows and Linux but which blow up on OS X due to its JDK directory structure being different such as:

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

Instead of doing ^ please do the following. There is an example in clustering/pom.xml for tools.jar, and there will be one (once tests pass) in cli/pom.xml for jconsole.jar:

    <profiles>
        <profile>
            <id>linux-windows</id>
            <activation>
                <file><exists>${java.home}/../lib/tools.jar</exists></file>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>sun.jdk</groupId>
                    <artifactId>jconsole</artifactId>
                    <version>jdk</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/jconsole.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>os-x</id>
            <activation>
                <file><exists>${java.home}/bundle/Classes/classes.jar</exists></file>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>sun.jdk</groupId>
                    <artifactId>jconsole</artifactId>
                    <version>jdk</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/bundle/Classes/jconsole.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
    </profiles>    


More information about the jboss-as7-dev mailing list