jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-806

tools.jar needs to be supported as a normal dependency

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.0-beta-1
  • Component/s: None
  • Labels:
    None
  • Environment:
    sun sdk
  • Complexity:
    Intermediate

Description

Sun SDKs have a tools.jar that provides API for extending the Sun java tools. This includes APT and Javadoc. There is no mechanism in maven for loading in tools.jar as a dependency. It can be added to the classpath before maven is launched, or manually loaded into the local repository. However, neither of these solutions are very satisfactory.

Could we have some smarts in the dependency loading that understands a magical jdk groupId that resolves to the current JDK being used for compilation? This would let JDK-dependent stuff be linked in. In the case of tools.jar, the dependency snippet would look something like this:

<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<type>jar</type>
<scope>provided</scope>
</dependency>

  • Options
    • Show All
    • Show Open

Sub-Tasks

1.
mvn site:site fails generating the dependencies if the MNG-806 fix is present Sub-task Closed Closed Carlos Sanchez
 

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brett Porter added a comment - 30/Aug/05 7:45 AM

John is working on a related fix.

Show
Brett Porter added a comment - 30/Aug/05 7:45 AM John is working on a related fix.
Hide
Permalink
John Casey added a comment - 12/Sep/05 3:03 PM

I've added a new type of dependency to the mix: scope == system.

This new dependency has the potential to break portability, but is used to incorporate dependencies that are assumed to be on the system already at build time...for instance, tools.jar. To use this for the tools.jar, specify:

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

HOWEVER, this path specification will lead to failure of the build when run on OS X or any non-Sun JDK...hence the portability warning above. My suggestion is that these dependencies be used with the utmost care. Multiple profiles activated based on 'os.name' or similar might help to mitigate the breakage on non-Sun platforms. See it0063 for more information.

Show
John Casey added a comment - 12/Sep/05 3:03 PM I've added a new type of dependency to the mix: scope == system. This new dependency has the potential to break portability, but is used to incorporate dependencies that are assumed to be on the system already at build time...for instance, tools.jar. To use this for the tools.jar, specify: <dependency> <groupId>sun.jdk</groupId> <artifactId>tools</artifactId> <version>1.4.2_08</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> HOWEVER, this path specification will lead to failure of the build when run on OS X or any non-Sun JDK...hence the portability warning above. My suggestion is that these dependencies be used with the utmost care. Multiple profiles activated based on 'os.name' or similar might help to mitigate the breakage on non-Sun platforms. See it0063 for more information.
Hide
Permalink
Brett Porter added a comment - 12/Sep/05 9:38 PM

fixing fix for

Show
Brett Porter added a comment - 12/Sep/05 9:38 PM fixing fix for
Hide
Permalink
Matthew Pocock added a comment - 11/Oct/05 2:45 PM

This is great. Adding dependencies to the profiles section would work arround the issue with osx, and possibly be generally useful, particularly if there was a library of profiles & dependencies for different platforms.

Show
Matthew Pocock added a comment - 11/Oct/05 2:45 PM This is great. Adding dependencies to the profiles section would work arround the issue with osx, and possibly be generally useful, particularly if there was a library of profiles & dependencies for different platforms.

People

  • Assignee:
    John Casey
    Reporter:
    Matthew Pocock
Vote (0)
Watch (0)

Dates

  • Created:
    30/Aug/05 7:43 AM
    Updated:
    01/Feb/06 2:44 PM
    Resolved:
    12/Sep/05 9:45 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.