Skip to content
Permalink
Browse files

[JENKINS-21268] Don't reference maven classes if plugin is deactivated.

  • Loading branch information
uhafner committed Jan 11, 2014
1 parent 17b8a47 commit 04d18b8d0a6977322126739669024d40b6bd1edb
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-pom</artifactId>
<version>1.47</version>
<version>1.48</version>
<relativePath>../../analysis-pom/pom.xml</relativePath>
</parent>

@@ -44,7 +44,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.54</version>
<version>1.55-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
@@ -9,6 +9,7 @@

import hudson.Plugin;

import hudson.plugins.analysis.core.PluginDescriptor;
import hudson.plugins.analysis.views.DetailFactory;

/**
@@ -28,7 +29,9 @@ public void start() throws IOException, SAXException {
FindBugsMessages.getInstance().initialize();
FindBugsDetailFactory detailBuilder = new FindBugsDetailFactory();
DetailFactory.addDetailBuilder(FindBugsResultAction.class, detailBuilder);
DetailFactory.addDetailBuilder(FindBugsMavenResultAction.class, detailBuilder);
if (PluginDescriptor.isMavenPluginInstalled()) {
MavenInitialization.run(detailBuilder);
}

if (oldProperty != null) {
System.setProperty(SAX_DRIVER_PROPERTY, oldProperty);
@@ -0,0 +1,27 @@
package hudson.plugins.findbugs;

import hudson.plugins.analysis.views.DetailFactory;

/**
* Initialization of Maven classes.
*
* @author Ulli Hafner
*/
public final class MavenInitialization {
/**
* Initializes the detail builder for Maven builds.
*
* @param detailBuilder
* the builder to use
*/
public static void run(final DetailFactory detailBuilder) {
DetailFactory.addDetailBuilder(FindBugsMavenResultAction.class, detailBuilder);
}

/**
* Creates a new instance of {@link MavenInitialization}.
*/
private MavenInitialization() {
// prevents instantiation
}
}

0 comments on commit 04d18b8

Please sign in to comment.
You can’t perform that action at this time.