I tried to run the prototype and updated the Wiki based on the experience.
https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+plugin+development+in+Ruby
I've not yet succeeded to run the prototype though... I'll investigate it later.
At present, command jpi seems to raise 'LoadError: no such file to
load -- jpi/cli'. I don't think jpi is ready at present but isn't it a
moving issue?
Thanks,
// NaHi
On Thu, Sep 1, 2011 at 03:15, Charles Lowell <cow...@thefrontside.net> wrote:
> Sorry about that. The jpi command is a "work in progress". It's going
> to be the destination for what is now currently in rake tasks, but it
> currently doesn't do anything.
>
> You should just be able to run
>
> `rake server ` in the prototype plugin directory.
Thanks. Good to hear it's known issue.
Besides this, I still cannot run ruby-prototype.hpi.
1) pom.xml in ruby-runtime-plugin points jruby-xstream:1.3-SNAPSHOT. I
changed it to 1.3.
2) Gemfile in jenkins-prototype-ruby-plugin has a "jenkins-plugin"
entry which points to a git repo. If I understand correctly, bundler
does not handle cascading dependency for a git repo (I'm not familiar
with bundler. Correct me if I'm wrong) so I added following definition
to Gemfile.
gem "jenkins-plugin", :git => "https://github.com/cowboyd/jenkins-plugin.git"
+ group :cascade_dependency_for_git_repo do
+ gem "rubyzip"
+ gem "thor"
+ gem "jenkins-war"
+ end
3) Now I could build ruby-prototype.hpi, but it raises the following
exception when I run it.
% rm -rf work
% jruby -S rake server
Copying plugin dependencies into work/plugins
cp /home/nahi/.m2/repository/org/jenkins-ci/plugins/ruby-runtime/0.1-SNAPSHOT/ruby-runtime-0.1-SNAPSHOT.hpi
work/plugins/ruby-runtime.hpi
Listening for transport dt_socket at address: 8000
Running from: /home/nahi/git/jruby/lib/ruby/gems/1.8/gems/jenkins-war-1.428/lib/jenkins/jenkins.war
webroot: System.getProperty("JENKINS_HOME")
[Winstone 2011/09/01 13:56:25] - Beginning extraction from war file
Jenkins home directory:
/home/nahi/git/jenkins-prototype-ruby-plugin/work found at:
System.getProperty("JENKINS_HOME")
[Winstone 2011/09/01 13:56:27] - HTTP Listener started: port=8080
[Winstone 2011/09/01 13:56:27] - AJP13 Listener started: port=8009
Using one-time self-signed certificate
[Winstone 2011/09/01 13:56:27] - Winstone Servlet Engine v0.9.10
running: controlPort=disabled
Sep 1, 2011 1:56:27 PM jenkins.model.Jenkins$6 onAttained
INFO: Started initialization
Sep 1, 2011 1:56:29 PM hudson.PluginManager$1$3$1 isDuplicate
INFO: Ignoring /home/nahi/git/jenkins-prototype-ruby-plugin/work/plugins/ruby-prototype.hpl
because /home/nahi/git/jenkins-prototype-ruby-plugin/work/plugins/ruby-prototype.hpl
is already loaded
Sep 1, 2011 1:56:30 PM jenkins.model.Jenkins$6 onAttained
INFO: Listed all plugins
Sep 1, 2011 1:56:32 PM jenkins.model.Jenkins$6 onTaskFailed
SEVERE: Failed Loading plugin ruby-prototype
hudson.util.IOException2: Failed to initialize
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:327)
at hudson.PluginManager$2$1$1.run(PluginManager.java:285)
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.NoSuchMethodError:
org.jenkinsci.jruby.JRubyXStream.register(Lcom/thoughtworks/xstream/XStream;Lorg/jenkinsci/jruby/RubyRuntimeResolver;)V
at ruby.RubyPlugin.initRubyXStreams(RubyPlugin.java:164)
at ruby.RubyPlugin.start(RubyPlugin.java:150)
at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:335)
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:324)
... 9 more
Sep 1, 2011 1:56:32 PM jenkins.model.Jenkins$6 onAttained
INFO: Prepared all plugins
Sep 1, 2011 1:56:32 PM jenkins.model.Jenkins$6 onAttained
INFO: Started all plugins
Sep 1, 2011 1:56:32 PM jenkins.model.Jenkins$6 onAttained
INFO: Augmented all extensions
Sep 1, 2011 1:56:32 PM jenkins.model.Jenkins$6 onAttained
INFO: Loaded all jobs
Sep 1, 2011 1:56:34 PM hudson.FilePath _chmodAnt
WARNING: GNU C Library not available: Using Ant's chmod task instead.
Sep 1, 2011 1:56:34 PM jenkins.model.Jenkins$6 onAttained
INFO: Completed initialization
Sep 1, 2011 1:56:34 PM hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 52147
Sep 1, 2011 1:56:46 PM hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running
Am I using wrong version of jruby-xstream? I'll investigate it later...
// NaHi
> Hi,
>
> On Thu, Sep 1, 2011 at 03:15, Charles Lowell <cow...@thefrontside.net> wrote:
>> Sorry about that. The jpi command is a "work in progress". It's going
>> to be the destination for what is now currently in rake tasks, but it
>> currently doesn't do anything.
>>
>> You should just be able to run
>>
>> `rake server ` in the prototype plugin directory.
>
> Thanks. Good to hear it's known issue.
>
> Besides this, I still cannot run ruby-prototype.hpi.
>
> 1) pom.xml in ruby-runtime-plugin points jruby-xstream:1.3-SNAPSHOT. I
> changed it to 1.3.
>
> 2) Gemfile in jenkins-prototype-ruby-plugin has a "jenkins-plugin"
> entry which points to a git repo. If I understand correctly, bundler
> does not handle cascading dependency for a git repo (I'm not familiar
> with bundler. Correct me if I'm wrong) so I added following definition
> to Gemfile.
>
> gem "jenkins-plugin", :git => "https://github.com/cowboyd/jenkins-plugin.git"
> + group :cascade_dependency_for_git_repo do
> + gem "rubyzip"
> + gem "thor"
> + gem "jenkins-war"
> + end
bundler should handle installing these dependencies, but maybe I've got it wrong. Can you file an issue on the prototype so we don't forget this?
The good news is that your ruby-runtime-plugin is correct, but it looks like you are using an old version of jruby-xstream. Make sure that you do a
`mvn clean install` in the ruby-runtime-plugin so that it deletes old copies of jruby-xstream. I ran into this issue where ruby-runtime-plugin.hpi had two copies of jruby-xstream.jar
cheers,
Charles
>
> // NaHi
(2011/09/01 21:31), Charles Lowell wrote:
>> 2) Gemfile in jenkins-prototype-ruby-plugin has a
>> "jenkins-plugin" entry which points to a git repo. If I
>> understand correctly, bundler does not handle cascading
>> dependency for a git repo (I'm not familiar with bundler. Correct
>> me if I'm wrong) so I added following definition to Gemfile.
>>
>> gem "jenkins-plugin", :git =>
>> "https://github.com/cowboyd/jenkins-plugin.git" + group
>> :cascade_dependency_for_git_repo do + gem "rubyzip" + gem
>> "thor" + gem "jenkins-war" + end
>
> bundler should handle installing these dependencies, but maybe I've
> got it wrong. Can you file an issue on the prototype so we don't
> forget this?
OK. I'll do that after sending this mail.
>> 3) Now I could build ruby-prototype.hpi, but it raises the
>> following exception when I run it.
>> Am I using wrong version of jruby-xstream? I'll investigate it
>> later...
>
> The good news is that your ruby-runtime-plugin is correct, but it
> looks like you are using an old version of jruby-xstream. Make sure
> that you do a
>
> `mvn clean install` in the ruby-runtime-plugin so that it deletes
> old copies of jruby-xstream. I ran into this issue where
> ruby-runtime-plugin.hpi had two copies of jruby-xstream.jar
That's it! After rebuilding ruby-runtime-plugin, rake server works
like a charm. Thank you! Hope I can write some code before the next
hack session. Heh, I've not yet written any code :)
Regards,
// NaHi