java - 我可以将tools.jar上传到Maven Central吗?

标签 java maven jdi

我的应用程序使用 JDI 调试器类,这些类位于 tools.jar 中。我希望使用 Maven 将应用程序打包为独立的(即创建 foo-with-dependencies.jar )。

但是,tools.jar不在 Maven Central 上。

热门solution Stack Overflow 上无效,因为 <scope>system</scope>防止tools.jar放入foo-with-dependencies.jar .

Maven 中心缺少 tools.jar 是否有任何许可原因?可以上传tools.jarMaven Central

最佳答案

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.

嗯,你的案例位于 guide central repository upload 之上。不。这不符合基本要求。

如果您是所有者或许可证允许您这样做,您可以将 tools.jar 上传到 Maven Central。

根据Maven Apache您可以通过以下方式将 tools.jar 添加到 pom.xml 中:

  <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>

这仍然意味着 tools.jar 在 Maven Central 中不可用,而且看起来永远不会在那里。

关于java - 我可以将tools.jar上传到Maven Central吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39868620/

相关文章:

java - 在 JPA 中将实体添加到大型多对多关系中

java - Spring Boot 应用程序。 SecurityContextHolder 与 HttpSession

java - 将两个 for 循环转换为 Java Stream?

java - 失败 : org. apache.maven 插件 :maven-jar-plugin:2. 6:test-jar

Java插件开发调试接口(interface)问题

Java String parseFloat 或 double 表示 x.xxxxxx 数字?

eclipse - 插件org.eclipse.m2e.core.ui无法加载类

java - maven 与 JDK11 : javac: invalid flag: --release

java - 远程 JVM 中对象的 JDI 镜像的生命周期

eclipse - JDI 事件调度空指针异常