我的一个项目中有一个依赖项,它没有声明自己所需的依赖项。我如何将 dep 及其 deps 组合成单个 maven Artifact ,以便我可以依赖这个单个 Artifact ?
第一个(也许?第二个)实现依赖是实际的公共(public) API。
repositories {
maven {
url 'http://devsite.ctr-electronics.com/maven/release/'
}
}
dependencies {
implementation "com.ctre.phoenix:api-java:5.14.1"
implementation "com.ctre.phoenix:wpiapi-java:5.14.1"
implementation "com.ctre.phoenix:cci:5.14.1"
implementation "com.ctre.phoenix:canutils:5.14.1"
implementation "com.ctre.phoenix:platform-stub:5.14.1"
}
最佳答案
使用 java-library
插件(强调我的):
https://docs.gradle.org/current/userguide/java_library_plugin.html
The
api
configuration should be used to declare dependencies which are exported by the library API, whereas theimplementation
configuration should be used to declare dependencies which are internal to the component.
所以改变
implementation
至api
对于您希望在类路径上公开的依赖项。
关于maven - 如何将多个依赖项组合成一个 Maven Artifact ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58211081/