[FIXED JENKINS-15977] ClassNotFound is maven plugin not installed #14

Merged
merged 1 commit into from Feb 4, 2014

Conversation

Projects
None yet
5 participants
Member

cjo9900 commented Dec 7, 2012

Check for the maven plugin being installed before trying to see
if the project src is a maven project.

@cjo9900 cjo9900 [FIXED JENKINS-15977] ClassNotFound is maven plugin not installed
Check for the maven plugin being installed before trying to see
if the project src is a maven project.
6cd2d83

Jenkins » copyartifact-plugin #13 SUCCESS
This pull request looks good
(what's this?)

Owner

jenkinsadmin commented Jul 17, 2013

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

Member

ikedam commented Jul 18, 2013

This change seems correct, and should be merged.
I want to reproduce the problem, and see this works.

Please let me know how to reproduce this.
Maven-plugin should be bundled with jenkins.war and always available, isn't it?

Member

ikedam commented Feb 4, 2014

I reproduced the problem by disabling maven-plugin in Manage Plugins.
It worked perfect.

@ikedam ikedam added a commit that referenced this pull request Feb 4, 2014

@ikedam ikedam Merge pull request #14 from cjo9900/JENKINS-15977
[FIXED JENKINS-15977] ClassNotFound is maven plugin not installed
d00c855

@ikedam ikedam merged commit d00c855 into jenkinsci:master Feb 4, 2014

I think you also have to check whether the plugin is active, just because the plugin is installed, does not mean its classes are available...
Hudson.getInstance().getPlugin("maven-plugin").getWrapper().isEnabled()
beware of NPE...

Member

ikedam replied Feb 5, 2014

Do you know how I can produce the case Hudson.getInstance().getPlugin("maven-plugin").getWrapper().isEnabled() is false?
I want to test the behavior in my environment.

Member

imod replied Feb 5, 2014

just disable the plugin in the plugin manager (GUI)

Member

ikedam replied Feb 5, 2014

I could not produce a problem in following steps:

  1. Disable Maven plugin (and did not restart Jenkins)
  2. Install Copy Artifact plugin
  3. Run a build with Copy Artifact

I tested with Jenkins 1.532.1.
Plugins can access classes of disabled plugins until Jenkins restarts, can't they?
(and after restarting, getPlugin("maven-plugin") return null)

Member

imod replied Feb 5, 2014

hmm, I'm not 100% sure - but is an easy check and I would just add it anyway - that's also what I see in most places where people have implemented checks like this ...it will for sure not hurt :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment