Skip to content

Commit

Permalink
[FIXED JENKINS-40447] Use AbstractSynchronousNonBlockingStepExecution…
Browse files Browse the repository at this point in the history
…, which requires updating to 1.609.x.
  • Loading branch information
jglick committed Dec 14, 2016
1 parent 73fdcc6 commit f2a4519
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 48 deletions.
63 changes: 18 additions & 45 deletions pom.xml
Expand Up @@ -4,13 +4,13 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.580.1</version>
<version>2.19</version>
<relativePath/>
</parent>

<properties>
<findbugs-maven-plugin.version>3.0.1</findbugs-maven-plugin.version>
<findbugs.failOnError>true</findbugs.failOnError>
<workflow.version>1.4</workflow.version>
<jenkins.version>1.609.3</jenkins.version>
<workflow.version>1.14.2</workflow.version>
</properties>

<licenses>
Expand Down Expand Up @@ -49,53 +49,16 @@
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs-maven-plugin.version}</version>
<configuration>
<xmlOutput>true</xmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<failOnError>${findbugs.failOnError}</failOnError>
<omitVisitors>UnreadFields</omitVisitors>
</configuration>
<executions>
<execution>
<id>run-findbugs</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!--TODO: Remove after the update to 1.594+-->
<!--Prevents a conflict with groovy-all package, which happens for the default 1.5-jenkins-1-->
<plugin>
<plugin> <!-- TODO otherwise Groovy tests are uncompilable; cf. similar hack in workflow-cps -->
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.5-jenkins-3</version>
<configuration>
<providerSelection>1.7</providerSelection>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-1.7</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>maven.jenkins-ci.org</id>
<url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
Expand Down Expand Up @@ -130,7 +93,19 @@
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-aggregator</artifactId>
<artifactId>workflow-job</artifactId>
<version>${workflow.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>${workflow.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-durable-task-step</artifactId>
<version>${workflow.version}</version>
<scope>test</scope>
</dependency>
Expand All @@ -148,5 +123,3 @@
</dependency>
</dependencies>
</project>


3 changes: 2 additions & 1 deletion src/main/java/htmlpublisher/HtmlPublisher.java
Expand Up @@ -49,6 +49,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import jenkins.model.Jenkins;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

Expand Down Expand Up @@ -232,7 +233,7 @@ public static boolean publishReports(Run<?, ?> build, FilePath workspace, Launch
reportLines.add(tabItem);
}
// Add the JS to change the link as appropriate.
String hudsonUrl = Hudson.getInstance().getRootUrl();
String hudsonUrl = Jenkins.getActiveInstance().getRootUrl();
Job job = build.getParent();
reportLines.add("<script type=\"text/javascript\">document.getElementById(\"hudson_link\").innerHTML=\"Back to " + job.getName() + "\";</script>");
// If the URL isn't configured in Hudson, the best we can do is attempt to go Back.
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/htmlpublisher/HtmlPublisherTarget.java
Expand Up @@ -23,6 +23,8 @@

import hudson.util.HttpResponses;
import jenkins.model.RunAction2;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
Expand Down Expand Up @@ -252,6 +254,12 @@ protected String getTitle() {
public @Nonnull HtmlPublisherTarget getHTMLTarget() {
return HtmlPublisherTarget.this;
}

@Restricted(NoExternalUse.class) // read by Groovy view
public HTMLBuildAction getActualBuildAction() {
return actualBuildAction;
}

}

/**
Expand Down
Expand Up @@ -32,15 +32,15 @@
import hudson.model.TaskListener;
import java.util.Arrays;
import javax.inject.Inject;
import org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution;
import org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution;
import org.jenkinsci.plugins.workflow.steps.StepContextParameter;

/**
* Execution for {@link PublishHTMLStep}.
* @author Oleg Nenashev
* @since TODO
*/
public class PublishHTMLStepExecution extends AbstractSynchronousStepExecution<Void> {
public class PublishHTMLStepExecution extends AbstractSynchronousNonBlockingStepExecution<Void> {

@StepContextParameter
private transient TaskListener listener;
Expand Down
@@ -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"
xmlns:htmlpublisher="/htmlpublisher/lib">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<!--
This view is used to render the plugin side panel.
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<!--
This view is used to render the plugin side panel.
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/index.jelly
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<!--
This view is used to render the plugin list page.
Expand Down

0 comments on commit f2a4519

Please sign in to comment.