Skip to content

Commit

Permalink
[JENKINS-43887] Update parent POM to 2.X.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evaristo Gutiérrez committed Apr 27, 2017
1 parent 354bcce commit 819b000
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
14 changes: 11 additions & 3 deletions pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.580.1</version>
<version>2.26</version>
</parent>

<artifactId>conditional-buildstep</artifactId>
Expand All @@ -26,6 +26,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.javadoc.skip>true</maven.javadoc.skip>
<jenkins.version>1.580.1</jenkins.version>
<java.level>6</java.level>
</properties>
<licenses>
<license>
Expand Down Expand Up @@ -63,12 +65,18 @@
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.8</version>
<version>2.13</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-project</artifactId>
<version>1.0-beta-1</version>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>mailer</artifactId>
<version>1.17</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Expand Up @@ -111,7 +111,12 @@ private static List<SingleConditionalBuilder> getSingleConditionalBuildersFromMa
* @return
*/
public static boolean isMavenPluginInstalled() {
final hudson.Plugin plugin = Jenkins.getInstance().getPlugin("maven-plugin");
return plugin != null ? plugin.getWrapper().isActive() : false;
Jenkins j = Jenkins.getInstance();
if (j != null) {
final hudson.Plugin plugin = j.getPlugin("maven-plugin");
return plugin != null ? plugin.getWrapper().isActive() : false;
} else {
return false;
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/index.jelly
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
A buildstep wrapping any number of other buildsteps, controlling their execution based on a defined condition (e.g. BuildParameter).
</div>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">

<f:entry>
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
Used to retain backward compatibility... please use the 'Boolean condition'
The resolved value has to be <code>true</code> or <code>false</code> (where everything else then <code>true</code> is handled as <code>false</code>, case ignored).<br />
Expand Down
Expand Up @@ -21,7 +21,8 @@ public class ConfigFileBuildWrapperTest {
@Test
public void conditionalBuildersInMavenProjectMustBeResolvable() throws Exception {

final MavenModuleSet p = j.createMavenProject("mvn");
final MavenModuleSet p = j.createProject(MavenModuleSet.class, "mvn");
p.setRunHeadless(true);

ConditionalBuilder cBuilder = new ConditionalBuilder(new BooleanCondition("true"), new BuildStepRunner.Run());
Shell shell = new Shell("ls");
Expand Down

0 comments on commit 819b000

Please sign in to comment.