0

My application uses the JDI debugger classes, which are in tools.jar. I want the application to be packaged as standalone using Maven (ie creating a foo-with-dependencies.jar).

However, tools.jar is not on Maven Central.

Popular solution on Stack Overflow is not valid, since the <scope>system</scope> prevents tools.jar to be put in foo-with-dependencies.jar.

Are there any licensing reasons for the absence of tools.jar on Maven central? Can I upload tools.jar on Maven Central?

Community
  • 1
  • 1
Martin Monperrus
  • 1,845
  • 2
  • 19
  • 28

1 Answers1

1

Only releases can be uploaded to the central repository, that means files that won't change and that only depend on other files already released and available in the repository.

There are some requirements for the minimal information in the POMs that are in the central repository. The updated list of requirements can be found here.

Well, your case is on top of guide central repository upload. No. It's against basic requirements.

You can upload tools.jar to Maven Central if you're the owner or the license let's you do that.

According to Maven Apache you can add tools.jar to the pom.xml in a following way:

  <profiles>
    <profile>
      <id>default-tools.jar</id>
      <activation>
        <property>
          <name>java.vendor</name>
          <value>Sun Microsystems Inc.</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.4.2</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

This still means, that the tools.jar isn't available in Maven Central and it looks like it'll never be there.

Community
  • 1
  • 1
xenteros
  • 15,586
  • 12
  • 56
  • 91
  • The main reason is mostly the Oracle JDK license; you're allowed to distribute a runtime or JDK, separately distributing a component like the tools.jar is prohibited. http://stackoverflow.com/questions/22305686/is-it-safe-to-distribute-tools-jar-along-with-a-java-application-bundle – Gimby Oct 05 '16 at 08:51