Skip to content

Commit

Permalink
Merge pull request #14 from varyvol/JENKINS-43887
Browse files Browse the repository at this point in the history
[JENKINS-43887] Update parent POM to 2.X.
  • Loading branch information
imod committed May 8, 2017
2 parents 354bcce + a7db585 commit 3a5abfc
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
16 changes: 12 additions & 4 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 @@ -25,7 +25,9 @@
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.javadoc.skip>true</maven.javadoc.skip>
<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 3a5abfc

Please sign in to comment.