简体   繁体   English

SBT项目发布到Maven Central

[英]SBT Project Publish to Maven Central

I'm in the process of publishing my project in GitHub as a jar file to the Maven central nexus repo and I followed all the steps as mentioned in this documentation page from SBT! 我正在将我的项目在GitHub中作为jar文件发布到Maven central nexus repo,我按照SBT本文档页面中提到的所有步骤进行操作!

https://www.scala-sbt.org/release/docs/Using-Sonatype.html https://www.scala-sbt.org/release/docs/Using-Sonatype.html

But now when I ran 但现在我跑了

sbt publishSigned sbt publishSigned

command against my project, I get the following error: 对我的项目命令,我收到以下错误:

[info] Done packaging.
[error] gpg: keyblock resource '/Users/joesan/.sbt/gpg/secring.asc': No such file or directory
[error] gpg: no default secret key: No secret key
[error] gpg: signing failed: No secret key
[error] java.lang.RuntimeException: Failure running gpg --detach-sign.  Exit code: 2
[error]     at scala.sys.package$.error(package.scala:26)
[error]     at com.typesafe.sbt.pgp.CommandLineGpgSigner.sign(PgpSigner.scala:27)
[error]     at com.typesafe.sbt.pgp.PgpSettings$.$anonfun$signingSettings$2(PgpSettings.scala:157)
[error]     at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:240)
[error]     at scala.collection.immutable.Map$Map4.foreach(Map.scala:233)
[error]     at scala.collection.TraversableLike.flatMap(TraversableLike.scala:240)
[error]     at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:237)
[error]     at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
[error]     at com.typesafe.sbt.pgp.PgpSettings$.$anonfun$signingSettings$1(PgpSettings.scala:154)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:278)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (signedArtifacts) Failure running gpg --detach-sign.  Exit code: 2

Looks like it is expecting some secrte file and I do not have it on the path. 看起来它期待一些secrte文件,我没有在路径上。 How to get around with this issue? 如何解决这个问题? Any ideas? 有任何想法吗?

Find out where the missing file (secring.asc) is on your computer, you should have it if you followed the instructions. 找出计算机上丢失文件(secring.asc)的位置,如果按照说明操作,则应该使用它。 Then set the location in your ~/.sbt/gpg.sbt file: 然后在〜/ .sbt / gpg.sbt文件中设置位置:

pgpSecretRing := file("/tmp/secring.asc")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM