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 ee5c050 commit d53abb13ef92407a5dff51ce69dfa8a1829b4702
@@ -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>

@@ -31,7 +31,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.apache.commons</groupId>
@@ -1,6 +1,8 @@
package hudson.plugins.dry;

import hudson.Plugin;

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

/**
@@ -13,6 +15,8 @@
public void start() {
DryDetailBuilder detailBuilder = new DryDetailBuilder();
DetailFactory.addDetailBuilder(DryResultAction.class, detailBuilder);
DetailFactory.addDetailBuilder(DryMavenResultAction.class, detailBuilder);
if (PluginDescriptor.isMavenPluginInstalled()) {
MavenInitialization.run(detailBuilder);
}
}
}
@@ -0,0 +1,27 @@
package hudson.plugins.dry;

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(DryMavenResultAction.class, detailBuilder);
}

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

0 comments on commit d53abb1

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