Lennart Jörelid commented on Improvement MJSPC-53

I would suggest using the same solution that we did in the AspectJ plugin project: a dependencyManagement and profile addition as illustrated below. The benefit here is that you can simply add a new profile for each new JDK layout (hopefully relatively few).
The solution below supports the Apple JDK as well as Oracle's:

            <dependency>
                <groupId>com.sun</groupId>
                <artifactId>tools</artifactId>
                <version>${java.version}</version>
                <scope>system</scope>
                <systemPath>${toolsjar}</systemPath>
            </dependency>

and a set of profiles defining the toolsjar variable:

    <profiles>
        <profile>
            <id>standardToolsJar-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>appleJdkToolsJar-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>
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to