1
我使用gradle v3.4和maven-publish插件以及用於創建jar文件的陰影插件。我已經複製了下面的build.gradle的相關部分以及錯誤消息。當我使用publishing.publications(但我的jar沒有發佈到遠程nexus回購 - 我可以在本地發佈)時,我沒有收到錯誤消息。gradle發佈jar到nexus maven回購
的build.gradle
apply plugin: 'maven-publish'
publishing {
publications {
shadow(MavenPublication) {
from components.shadow
groupId 'com.test'
artifactId 'some-java'
}
}
repositories {
maven {
credentials {
username project.properties['nexusUsername']
password project.properties['nexusPassword']
}
url project.properties['nexus.url.snapshot']
}
}
錯誤
A problem occurred evaluating root project 'some-java'.
> Cannot configure the 'publishing' extension after it has been accessed.
我試過了艾爾雷。我使用的是shadowjar - jar/shadowjar任務都在發佈之前。 –