Quantcast

Problem releasing plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem releasing plugin

Jon Cairns
Hi,

As my first major Java project I've created a plugin for Jenkins
(https://github.com/jenkinsci/memegen-plugin). Basically, it creates a
meme from http://memegenerator.net and posts it on the project page
when a build fails/returns to normal - just a bit of fun :)  I'm the
first to admit that I'm a Java newbie, and a lot of this project has
been feeling my way around and following other plugins' examples.

I got it to the point where it was happy and stable, until I tried to
follow the steps to host it (from https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins).
There's a long line of commits where I kept modifying the pom.xml and
updating the version number, tweaking things to try and get it to
build during the "mvn release:prepare release:perform" step. I started
off using core version 1.355, before updating in increments because of
various different failures, and finally landing on version 1.428 -
this version got me the closest to actually deploying the damn thing,
but it then failed during the tests.

So, I tried going back to basics with "mvn install", which failed with
the following error:

"Tests in error:
  initializationError(InjectedTest): com.sun.jna.Native.open(Ljava/
lang/String;)J"

Here's the stack trace:

-----------------------------------------------------------------------------------
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-
plugin:2.8:test (default-test) on project memegen: There are test
failures.
[ERROR]
[ERROR] Please refer to /home/jon/projects/memegen/target/surefire-
reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8:test
(default-test) on project memegen: There are test failures.

Please refer to /home/jon/projects/memegen/target/surefire-reports for
the individual test results.
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
213)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
153)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
145)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:
84)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:
59)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:
183)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:
161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:
290)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:
230)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:
409)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoFailureException: There are
test failures.

Please refer to /home/jon/projects/memegen/target/surefire-reports for
the individual test results.
        at
org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:
74)
        at
org.apache.maven.plugin.surefire.SurefirePlugin.writeSummary(SurefirePlugin.java:
644)
        at
org.apache.maven.plugin.surefire.SurefirePlugin.executeAfterPreconditionsChecked(SurefirePlugin.java:
640)
        at
org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:
103)
        at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:
101)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
209)
        ... 19 more
-----------------------------------------------------------------------------------

I then tried running "mvn hpi:run", which I used the whole time during
my development. This failed, and gave the following exception:

-----------------------------------------------------------------------------------
...
12-Mar-2012 14:08:18 org.jvnet.hudson.test.TestExtensionLoader
findExtensions
WARNING: Failed to load org.jvnet.hudson.test.HudsonTestCase
$ComputerListenerImpl
java.lang.InstantiationException: /home/jon/.m2/repository/org/jenkins-
ci/main/jenkins-test-harness/1.428/jenkins-test-harness-1.428.jar
might need to be rebuilt: java.lang.ClassNotFoundException:
org.jvnet.hudson.test.HudsonTestCase$ComputerListenerImpl
        at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
        at
org.jvnet.hudson.test.TestExtensionLoader.findExtensions(TestExtensionLoader.java:
57)
        at
hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:
284)
        at hudson.ExtensionList.load(ExtensionList.java:258)
        at hudson.ExtensionList.ensureLoaded(ExtensionList.java:229)
        at hudson.ExtensionList.iterator(ExtensionList.java:136)
        at
hudson.model.AbstractProject.createTransientActions(AbstractProject.java:
611)
        at hudson.model.Project.createTransientActions(Project.java:203)
        at
hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:
602)
        at hudson.model.AbstractProject.onLoad(AbstractProject.java:272)
        at hudson.model.Project.onLoad(Project.java:88)
        at hudson.model.Items.load(Items.java:115)
        at jenkins.model.Jenkins$14.run(Jenkins.java:2341)
        at org.jvnet.hudson.reactor.TaskGraphBuilder
$TaskImpl.run(TaskGraphBuilder.java:146)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:795)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.ClassNotFoundException:
org.jvnet.hudson.test.HudsonTestCase$ComputerListenerImpl
        at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:
656)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
        at net.java.sezpoz.IndexItem.element(IndexItem.java:134)
        ... 20 more
Exception in thread "pool-20-thread-6" java.lang.NullPointerException
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
Exception in thread "pool-20-thread-4" java.lang.NullPointerException
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)

-----------------------------------------------------------------------------------

I've also tried updating the core to 1.451, which is the version of
Jenkins I currently use outside of development. This brought up
another problem altogether, but I don't want to cause death by stack
trace so I've left it out for the time being.

Could some kind person point me in the right direction?

Thanks,
Jon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem releasing plugin

Jon Cairns
Sorry to bump, but I'm still at a loss as to what the problem is with my plugin - I'm sure it's a configuration issue, but I don't have enough experience with Java or Jenkins plugins to be able to resolve it. Has anyone got any ideas?

Thanks

On Monday, March 12, 2012 2:18:06 PM UTC, Jon Cairns wrote:
Hi,

As my first major Java project I've created a plugin for Jenkins
(https://github.com/jenkinsci/memegen-plugin). Basically, it creates a
meme from http://memegenerator.net and posts it on the project page
when a build fails/returns to normal - just a bit of fun :)  I'm the
first to admit that I'm a Java newbie, and a lot of this project has
been feeling my way around and following other plugins' examples.

I got it to the point where it was happy and stable, until I tried to
follow the steps to host it (from https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins).
There's a long line of commits where I kept modifying the pom.xml and
updating the version number, tweaking things to try and get it to
build during the "mvn release:prepare release:perform" step. I started
off using core version 1.355, before updating in increments because of
various different failures, and finally landing on version 1.428 -
this version got me the closest to actually deploying the damn thing,
but it then failed during the tests.

So, I tried going back to basics with "mvn install", which failed with
the following error:

"Tests in error:
  initializationError(InjectedTest): com.sun.jna.Native.open(Ljava/
lang/String;)J"

Here's the stack trace:

-----------------------------------------------------------------------------------
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-
plugin:2.8:test (default-test) on project memegen: There are test
failures.
[ERROR]
[ERROR] Please refer to /home/jon/projects/memegen/target/surefire-
reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8:test
(default-test) on project memegen: There are test failures.

Please refer to /home/jon/projects/memegen/target/surefire-reports for
the individual test results.
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
213)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
153)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
145)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:
84)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:
59)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:
183)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:
161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:
290)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:
230)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:
409)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoFailureException: There are
test failures.

Please refer to /home/jon/projects/memegen/target/surefire-reports for
the individual test results.
        at
org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:
74)
        at
org.apache.maven.plugin.surefire.SurefirePlugin.writeSummary(SurefirePlugin.java:
644)
        at
org.apache.maven.plugin.surefire.SurefirePlugin.executeAfterPreconditionsChecked(SurefirePlugin.java:
640)
        at
org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:
103)
        at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:
101)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:
209)
        ... 19 more
-----------------------------------------------------------------------------------

I then tried running "mvn hpi:run", which I used the whole time during
my development. This failed, and gave the following exception:

-----------------------------------------------------------------------------------
...
12-Mar-2012 14:08:18 org.jvnet.hudson.test.TestExtensionLoader
findExtensions
WARNING: Failed to load org.jvnet.hudson.test.HudsonTestCase
$ComputerListenerImpl
java.lang.InstantiationException: /home/jon/.m2/repository/org/jenkins-
ci/main/jenkins-test-harness/1.428/jenkins-test-harness-1.428.jar
might need to be rebuilt: java.lang.ClassNotFoundException:
org.jvnet.hudson.test.HudsonTestCase$ComputerListenerImpl
        at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
        at
org.jvnet.hudson.test.TestExtensionLoader.findExtensions(TestExtensionLoader.java:
57)
        at
hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:
284)
        at hudson.ExtensionList.load(ExtensionList.java:258)
        at hudson.ExtensionList.ensureLoaded(ExtensionList.java:229)
        at hudson.ExtensionList.iterator(ExtensionList.java:136)
        at
hudson.model.AbstractProject.createTransientActions(AbstractProject.java:
611)
        at hudson.model.Project.createTransientActions(Project.java:203)
        at
hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:
602)
        at hudson.model.AbstractProject.onLoad(AbstractProject.java:272)
        at hudson.model.Project.onLoad(Project.java:88)
        at hudson.model.Items.load(Items.java:115)
        at jenkins.model.Jenkins$14.run(Jenkins.java:2341)
        at org.jvnet.hudson.reactor.TaskGraphBuilder
$TaskImpl.run(TaskGraphBuilder.java:146)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:795)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.ClassNotFoundException:
org.jvnet.hudson.test.HudsonTestCase$ComputerListenerImpl
        at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:
656)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
        at net.java.sezpoz.IndexItem.element(IndexItem.java:134)
        ... 20 more
Exception in thread "pool-20-thread-6" java.lang.NullPointerException
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
Exception in thread "pool-20-thread-4" java.lang.NullPointerException
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)

-----------------------------------------------------------------------------------

I've also tried updating the core to 1.451, which is the version of
Jenkins I currently use outside of development. This brought up
another problem altogether, but I don't want to cause death by stack
trace so I've left it out for the time being.

Could some kind person point me in the right direction?

Thanks,
Jon
Previous Thread Next Thread
Loading...