rossabaker / sbt-signer-plugin

sbt-0.10 plugin to sign artifacts on publish (e.g., with pgp).
Other
6 stars 2 forks source link

Signer plugin not working unless I manually place jars in sbt boot directory #1

Open nafg opened 13 years ago

nafg commented 13 years ago

naftoli@naftoli-PC-kubuntu ~/dev/lrbcol[wip_165_166 ]$ ls $HOME/share/java bcpg-jdk16-146.jar bcprov-jdk16-146.jar naftoli@naftoli-PC-kubuntu ~/dev/lrbcol[wip_165_166 ]$ cat ~/.sbt/plugins/SignerPluginConfig.scala import sbt. import Keys. import com.rossabaker.sbt.signer.SignerPlugin import SignerPlugin.Keys._

object SignerPluginConfig extends Plugin { override lazy val settings = Seq( signatureGenerator := Some(SignerPlugin.OpenPgpSignatureGenerator( name = "", password = ""))) ++ SignerPlugin.signerSettings } naftoli@naftoli-PC-kubuntu ~/dev/lrbcol[wip_165166 *]$ cat ~/.sbt/plugins/project/gpg.scala import sbt. import sbt.Keys._

object PluginDef extends Build { override val projects = Seq(root) lazy val root = Project("plugins", file(".")) dependsOn (signerPlugin) lazy val signerPlugin = uri("git://github.com/rossabaker/sbt-signer-plugin") } naftoli@naftoli-PC-kubuntu ~/dev/lrbcol[wip_165_166 *]$ sbt [info] Set current project to plugins (in build file:/home/naftoli/.sbt/plugins/) java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider at org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator.(OpenPGPSignatureGenerator.java:50) at com.rossabaker.sbt.signer.SignerPlugin$.OpenPgpSignatureGenerator(SignerPlugin.scala:51) at SignerPluginConfig$$anonfun$settings$1.apply(SignerPluginConfig.scala:8) at SignerPluginConfig$$anonfun$settings$1.apply(SignerPluginConfig.scala:8) at sbt.Init$Value$$anonfun$map$2.apply(Settings.scala:215) at sbt.Init$Value.get(Settings.scala:216) at sbt.Init$class.sbt$Init$$applySetting(Settings.scala:144) at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100) at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100) at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123) at scala.collection.immutable.List.foldLeft(List.scala:45) at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139) at scala.collection.immutable.List.$div$colon(List.scala:45) at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100) at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100) at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140) at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140) at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123) at scala.collection.immutable.List.foldLeft(List.scala:45) at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139) at scala.collection.immutable.List.$div$colon(List.scala:45) at sbt.Init$class.sbt$Init$$applyInits(Settings.scala:140) at sbt.Init$class.make(Settings.scala:92) at sbt.Project$.make(Project.scala:102) at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177) at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177) at sbt.Project$.translateCyclic(Project.scala:218) at sbt.Project$.makeSettings(Project.scala:177) at sbt.Load$.apply(Load.scala:120) at sbt.Load$.buildPluginDefinition(Load.scala:408) at sbt.Load$.buildPlugins(Load.scala:393) at sbt.Load$.plugins(Load.scala:387) at sbt.Load$.loadUnit(Load.scala:357) at sbt.Load$$anonfun$7.apply(Load.scala:211) at sbt.Load$$anonfun$7.apply(Load.scala:211) at sbt.BuildLoader.apply(BuildLoader.scala:17) at sbt.Load$.loadAll(Load.scala:263) at sbt.Load$.loadURI(Load.scala:220) at sbt.Load$.load(Load.scala:216) at sbt.Load$.load(Load.scala:214) at sbt.Load$.apply(Load.scala:115) at sbt.Load$.defaultLoad(Load.scala:36) at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:371) at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:368) at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61) at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61) at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63) at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63) at sbt.Command$.process(Command.scala:91) at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66) at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66) at sbt.State$$anon$1.process(State.scala:59) at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66) at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:13) at sbt.MainLoop$.next(Main.scala:66) at sbt.MainLoop$.run(Main.scala:61) at sbt.xMain.run(Main.scala:33) at xsbt.boot.Launch$.run(Launch.scala:54) at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43) at xsbt.boot.Launch$.launch(Launch.scala:68) at xsbt.boot.Launch$.apply(Launch.scala:14) at xsbt.boot.Boot$.runImpl(Boot.scala:24) at xsbt.boot.Boot$.main(Boot.scala:15) at xsbt.boot.Boot.main(Boot.scala) Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator.(OpenPGPSignatureGenerator.java:50) at com.rossabaker.sbt.signer.SignerPlugin$.OpenPgpSignatureGenerator(SignerPlugin.scala:51) at SignerPluginConfig$$anonfun$settings$1.apply(SignerPluginConfig.scala:8) at SignerPluginConfig$$anonfun$settings$1.apply(SignerPluginConfig.scala:8) at sbt.Init$Value$$anonfun$map$2.apply(Settings.scala:215) at sbt.Init$Value.get(Settings.scala:216) at sbt.Init$class.sbt$Init$$applySetting(Settings.scala:144) at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100) at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100) at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123) at scala.collection.immutable.List.foldLeft(List.scala:45) at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139) at scala.collection.immutable.List.$div$colon(List.scala:45) at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100) at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100) at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140) at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140) at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123) at scala.collection.immutable.List.foldLeft(List.scala:45) at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139) at scala.collection.immutable.List.$div$colon(List.scala:45) at sbt.Init$class.sbt$Init$$applyInits(Settings.scala:140) at sbt.Init$class.make(Settings.scala:92) at sbt.Project$.make(Project.scala:102) at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177) at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177) at sbt.Project$.translateCyclic(Project.scala:218) at sbt.Project$.makeSettings(Project.scala:177) at sbt.Load$.apply(Load.scala:120) at sbt.Load$.buildPluginDefinition(Load.scala:408) at sbt.Load$.buildPlugins(Load.scala:393) at sbt.Load$.plugins(Load.scala:387) at sbt.Load$.loadUnit(Load.scala:357) at sbt.Load$$anonfun$7.apply(Load.scala:211) at sbt.Load$$anonfun$7.apply(Load.scala:211) at sbt.BuildLoader.apply(BuildLoader.scala:17) at sbt.Load$.loadAll(Load.scala:263) at sbt.Load$.loadURI(Load.scala:220) at sbt.Load$.load(Load.scala:216) at sbt.Load$.load(Load.scala:214) at sbt.Load$.apply(Load.scala:115) at sbt.Load$.defaultLoad(Load.scala:36) at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:371) at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:368) at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61) at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61) at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63) at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63) at sbt.Command$.process(Command.scala:91) at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66) at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66) at sbt.State$$anon$1.process(State.scala:59) at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66) at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:13) at sbt.MainLoop$.next(Main.scala:66) at sbt.MainLoop$.run(Main.scala:61) at sbt.xMain.run(Main.scala:33) at xsbt.boot.Launch$.run(Launch.scala:54) at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43) at xsbt.boot.Launch$.launch(Launch.scala:68) at xsbt.boot.Launch$.apply(Launch.scala:14) at xsbt.boot.Boot$.runImpl(Boot.scala:24) at xsbt.boot.Boot$.main(Boot.scala:15) at xsbt.boot.Boot.main(Boot.scala) [error] java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider [error] Use 'last' for the full log. Project loading failed: (r)etry, (q)uit, or (i)gnore?

rossabaker commented 13 years ago

Your configuration looks right. I heard from a Mac user who also had a problem, but didn't get any details.

We may want to add a bunch of debugging code in the augment method of the plugin if there's no obvious solution.

nafg commented 13 years ago

On Sat, Aug 13, 2011 at 10:39 PM, rossabaker < reply@reply.github.com>wrote:

Your configuration looks right. I heard from a Mac user who also had a problem, but didn't get any details.

  • Which version of sbt? It has to be 0.10.1.
  • If you run project-console from sbt, what does Path.userHome spit out?

We may want to add a bunch of debugging code in the augment method of the plugin if there's no obvious solution.

Reply to this email directly or view it on GitHub:

https://github.com/rossabaker/sbt-signer-plugin/issues/1#issuecomment-1800233

(uninteresting lines deleted)

naftoli@naftoli-PC-kubuntu ~/dev/lrbcol[master]$ sbt [info] Set current project to plugins (in build file:/home/naftoli/.sbt/plugins/) [info] Set current project to default-cf69d1 (in build file:/home/naftoli/dev/lrbcol/project/plugins/) [info] Set current project to root (in build file:/home/naftoli/dev/lrbcol/)

console-project [info] Starting scala interpreter... [info] import sbt. import Process. import Keys. import SignerPluginConfig. import com.rossabaker.sbt.signer.SignerPlugin. import com.typesafe.sbteclipse.SbtEclipsePlugin. import com.github.siasia.WebPlugin. import LrbcolBuild. import currentState. import extracted. Welcome to Scala version 2.8.1.final (OpenJDK 64-Bit Server VM, Java 1.6.0_22). Type in expressions to have them evaluated. Type :help for more information.

scala> Path.userHome res0: java.io.File = /home/naftoli

scala> exit

[success] Total time: 24 s, completed Aug 13, 2011 11:35:12 PM

inspect sbt-version [info] Setting: java.lang.String = 0.10.1 [info] Description: [info] Provides the version of sbt. This setting should be not be modified. [info] Provided by: [info] /:sbt-version [info] Delegates: [info] {file:/home/naftoli/dev/lrbcol/}root/:sbt-version [info] {file:/home/naftoli/dev/lrbcol/}/:sbt-version [info] /:sbt-version [info] Related: [info] /:sbt-version

To be clear, if I copy the jars manually to project/boot/.../extra it works, and that's what I've been doing. Unfortunately I seem to have to do that for every project. I couldn't figure out how to install it for only one project.

jhartman commented 13 years ago

I'm having this same issue on a mac. Not sure if switching to maven style dependencies would help.

rossabaker commented 13 years ago

Do you see this on projects with full (.scala) configurations, or just the quick (.sbt) configuration? I have seen this twice on my machine with quick configuration, but not consistently enough to determine a pattern. I have yet to see this on a full configuration. I'm still trying to get a handle on what triggers the intermittent behavior.

jhartman commented 13 years ago

Hi Ross,

I'm using a full configuration on OSX. The project is open sourced at https://github.com/jhartman/norbert, if that helps. I'd like to be able to publish it to maven central. I can try it on Linux when I get a new charger for my laptop.

I also wondered what your thoughts were on the global plugin system. It's a bit annoying to have it signing packages for every project (especially with this issue), and it would be nice if we could use it as a normal plugin but specify a credentials file instead.

rossabaker commented 13 years ago

Excellent question. Since signing artifacts has been a hassle back to the sbt-0.7 days, I like that it can be stashed away as a global plugin, so it's a concern of the release manager and doesn't bother random forkers. On the other hand, it sucks to have to sign everything.

Ideally, I think the plugin should be able to sign artifacts either globally or per-project, and a project would not (necessarily? ever?) fail if no credentials were found in a global config. This plugin should be low maintenance for release managers and random forkers alike.