当我在一个测试项目上试用我的作品时,我就可以在bin托盘上发表我的工作了。
repositories {
maven("https://dl.bintray.com/user/libraries/")
}
dependencies {
implementation("com.user.project:project-name:version")
}我在Gradle构建上没有错误。
我可以在https://dl.bintray.com/user/libraries/上看到我的jar文件
com/
user/
project/
projec-name/
| -- maven-metadata.xml
| -- version
| -- pom.xml
| -- project-name-version-jvm.jar
| -- project-name-meta-data-version-sources.jar
| -- project-name-meta-data-version.jar上传到绑定盘上似乎没什么不对
在IntelliJ右侧窗格的Gradle选项卡下,项目列在runtimeClassPath上,而非compileClassPath上也没有从External Dependencies下载的jar文件
这是我的
build.gradle.kts
publishing {
publications {
create<MavenPublication>("project-name") {
pom {
name.set("project-name")
description.set("My project descriptoin")
url.set("https://github.com/user/project-name")
licenses {
license {
name.set("Apache License 2.0")
url.set("https://github.com/user/project-name/blob/master/LICENSE")
}
}
developers {
developer {
id.set("user")
name.set("user")
}
}
scm {
connection.set("scm:git:git://github.com/user/project-name.git")
url.set("https://github.com/user/project-name")
}
}
}
}
}
bintray {
user = "user"
key = "key"
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
repo = "libraries"
name = "project-name"
userOrg = "user"
setPublications("project-name") // should be same as set in Maven Publication above
filesSpec(delegateClosureOf<CopySpec> {
from("build/libs/")
into("com/user/project/project-name/version") // this i think where the issue is, altho can't verify
})
})
}但是,当我通过依赖关系将它放到我的项目上时,为什么不能得到任何jars。
我很想了解一下我在哪里做错了这件事
额外问题:如果我目前只针对JVM,那么除以jvm作为后缀外,是否可以安全地删除所有其他jars。
发布于 2020-06-15 10:36:19
上传的工件与Maven布局不匹配。
主要工件应该称为project-name-version.jar。-meta-data在源和备用JAR中的存在也意味着它们不会被视为包含Maven分类器的归档文件。
说格拉德尔应该抱怨找不到那个罐子。
您用来测试消耗的任务是什么?
https://stackoverflow.com/questions/62366952
复制相似问题