SBT程序集将fat jar发布到Nexus
我正试图将SBT程序集将fat jar发布到Nexus,sbt,nexus,sbt-assembly,Sbt,Nexus,Sbt Assembly,我正试图将sbt publish生成的胖jar推送到一个私有的Nexus存储库中。因此,在我的Nexus中,我创建了两个存储库,一个托管快照版本,一个托管发布工件 以下是我的build.sbt中的重要代码: publishTo := { val nexus = "http://localhost:8081/" if (isSnapshot.value) Some("snapshots" at nexus + "repository/test-snapshots") else
sbt publish
生成的胖jar推送到一个私有的Nexus存储库中。因此,在我的Nexus中,我创建了两个存储库,一个托管快照版本,一个托管发布工件
以下是我的build.sbt
中的重要代码:
publishTo := {
val nexus = "http://localhost:8081/"
if (isSnapshot.value)
Some("snapshots" at nexus + "repository/test-snapshots")
else
Some("releases" at nexus + "repository/test-releases")
}
credentials += Credentials(
"Sonatype Nexus Repository Manager", "localhost", "admin", "admin123"
)
artifact in (Compile, assembly) := {
val art = (artifact in (Compile, assembly)).value
art.withClassifier(Some("assembly"))
}
addArtifact(artifact in (Compile, assembly), assembly)
这是stacktrace的一部分:
[info] Assembly up to date: /.../target/scala-2.11/test-assembly-1.0-SNAPSHOT.jar
[info] published test_2.11 to http://localhost:8081/repository/test-snapshots/com/test/test_2.11/1.0-SNAPSHOT/test_2.11-1.0-SNAPSHOT-javadoc.jar
[info] published test_2.11 to http://localhost:8081/repository/test-snapshots/com/test/test_2.11/1.0-SNAPSHOT/test_2.11-1.0-SNAPSHOT-sources.jar
[info] published test_2.11 to http://localhost:8081/repository/test-snapshots/com/test/test_2.11/1.0-SNAPSHOT/test_2.11-1.0-SNAPSHOT.jar
[info] published test_2.11 to http://localhost:8081/repository/test-snapshots/com/test/test_2.11/1.0-SNAPSHOT/test_2.11-1.0-SNAPSHOT.pom
[error] java.net.SocketException: Broken pipe (Write failed)
因此,正如我们所看到的,它能够发布工件直到pom文件
提前感谢您的帮助 我可以使用您粘贴的代码发布。您可能正在处理网络/连接问题。