我的应用程序使用 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.jar
上Maven 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/