How to setup a jenkins plugin debug environment on windows 8.1?

78 views
Skip to first unread message

Ivo Bellin Salarin

unread,
Dec 5, 2014, 10:38:48 AM12/5/14
to jenkin...@googlegroups.com
Well,

I would try to setup a debug environment for a jenkins plugin (git-client-plugin) on windows 8.1.
But I'm failing at it, and I don't know how to proceed.

So far: I have installed netbeans 8.0.1 and the sources of git-client-plugin from github. I have built the sources using netbeans/maven, and I am able to run jenkins using mvn hpi:run.

But: 
1) NetBeans doesn't propose me to debug the plugin. The debug button is grayed out.
2) Git-client-plugin is part of a chain of plugins. The final user of this plugin chain is git-plugin. If I deploy git-plugin and all of its dependencies, I get other exceptions, like "cycle detected (git-client -> git-server -> git-client)"
3) deleting git-server, I get an error concerning the absence of git-client 1.11.1...

Well, do somebody have noob instructions about how to setup a debug environment for git-client-plugin?

thanks in advance,
Ivo

Mark Waite

unread,
Dec 5, 2014, 11:05:55 AM12/5/14
to jenkin...@googlegroups.com
I have a Windows 8 machine that I use occasionally.  I have never tried to configure a debug environment on it.  If you don't get an answer from anyone else in the next 24 hours, I may be able to provide some hints / steps / instructions.

I won't be able to assist with debugging multiple plugins in a single debugging session, because I've never done that.  I'm confident it is possible, I've just never done it.

My experience with git-plugin and git-client-plugin development on Windows was somewhat frustrating.  As far as I could tell, most Jenkins core developers develop on Linux.  That means they don't generally see the file system locking related exceptions thrown in tests on Windows.

I still run git-plugin and git-client-plugin tests on Windows, but my primary development environment is a Ubuntu 14.04 machine with an SSD.  It runs much faster than any of my Windows machines ever did.

Mark Waite


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF9bU09M4%2BXb7Ox1sYhnCOX1iJBis6O2uJx%2BBkKT%2Ba9jbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite

James Nord

unread,
Dec 5, 2014, 11:32:19 AM12/5/14
to jenkin...@googlegroups.com
I use eclipse but it should be very similar as outlined at https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-DebuggingaPlugin

the bits that is missing is in eclipse I then "attach to a process" and add the source location from my local workspace...

/James

Ivo Bellin Salarin

unread,
Dec 8, 2014, 7:48:52 AM12/8/14
to jenkin...@googlegroups.com
Let me give you some more information:

I have been able to attach NetBeans to the Jenkins instance. (thanks, James Nord).

But, there's something strange in the git-client.hpl that I can find in the work\plugins\git-client.hpl. Here's an excerpt:

Manifest-Version: 1.0
Group-Id: org.jenkins-ci.plugins
Short-Name: git-client
Long-Name: Jenkins GIT client plugin
Plugin-Version: 1.12.1-SNAPSHOT (private-12/08/2014 13:41-BELLINSALARIN)
Hudson-Version: 1.509
Jenkins-Version: 1.509
Plugin-Dependencies: ssh-credentials:1.10,git-server:1.5,ui-samples-plugin:1.509
Plugin-Developers: Nicolas De Loof:ndeloof:nicolas...@gmail.com,Ma

The line Plugin-dependencies lists git-server and ui-samples-plugin. This hpl differs from the MANIFEST-MF that I can find in the git-client.hpi. How's that possible? How is it generated?

Ivo Bellin Salarin

unread,
Dec 8, 2014, 8:04:17 AM12/8/14
to jenkin...@googlegroups.com
The pom.xml file is responsible for this dependency. 

Changing the pom.xml to comment out this dependency, I get a 
java.lang.Error: java.lang.reflect.InvocationTargetException
while calling descriptior.Save()

        DescriptorImpl descriptor = (DescriptorImpl) Jenkins.getInstance().getDescriptor(GitTool.class);
        GitTool[] installations = getInstallations(descriptor);

        if (installations != null && installations.length > 0) {
            //No need to initialize if there's already something
            return;
        }

        String defaultGitExe = Functions.isWindows() ? "git.exe" : "git";
        GitTool tool = new GitTool(DEFAULT, defaultGitExe, Collections.<ToolProperty<?>>emptyList());
        descriptor.setInstallations(new GitTool[] { tool });
        descriptor.save();

any ideas to pass further ?


To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.

Mark Waite

unread,
Dec 8, 2014, 8:05:57 AM12/8/14
to jenkin...@googlegroups.com
On Mon, Dec 8, 2014 at 5:48 AM, Ivo Bellin Salarin <ivo.bell...@gmail.com> wrote:
Let me give you some more information:

I have been able to attach NetBeans to the Jenkins instance. (thanks, James Nord).

But, there's something strange in the git-client.hpl that I can find in the work\plugins\git-client.hpl. Here's an excerpt:

Manifest-Version: 1.0
Group-Id: org.jenkins-ci.plugins
Short-Name: git-client
Long-Name: Jenkins GIT client plugin
Plugin-Version: 1.12.1-SNAPSHOT (private-12/08/2014 13:41-BELLINSALARIN)
Hudson-Version: 1.509
Jenkins-Version: 1.509
Plugin-Dependencies: ssh-credentials:1.10,git-server:1.5,ui-samples-plugin:1.509
Plugin-Developers: Nicolas De Loof:ndeloof:nicolas...@gmail.com,Ma

The line Plugin-dependencies lists git-server and ui-samples-plugin. This hpl differs from the MANIFEST-MF that I can find in the git-client.hpi. How's that possible? How is it generated?


I'm not a maven expert, but I wonder if the git-server is inserted in one place and not another because it is a test dependency.  The git-server dependency is not required outside of tests.

Mark Waite

 

For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite
Reply all
Reply to author
Forward
0 new messages