Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Jenkins 2.479.1 or newer #169

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>5.5</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -33,8 +33,8 @@
<properties>
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<jenkins.baseline>2.452</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.4</jenkins.version>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.threshold>Low</spotbugs.threshold>
<spotless.check.skip>false</spotless.check.skip>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/hudson/tasks/JavadocArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
import hudson.model.*;
import hudson.tasks.javadoc.Messages;
import hudson.util.FormValidation;
import jakarta.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import javax.servlet.ServletException;
import jenkins.model.RunAction2;
import jenkins.tasks.SimpleBuildStep;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;

/**
* Saves Javadoc for the project and publish them.
Expand Down Expand Up @@ -153,7 +153,7 @@ public String getIconFileName() {
/**
* Serves javadoc.
*/
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
public void doDynamic(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException {
final File basedir = dir();
DirectoryBrowserSupport dbs =
new DirectoryBrowserSupport(this, new FilePath(basedir), getTitle(), JAVADOC_ICON, false);
Expand Down
20 changes: 12 additions & 8 deletions src/test/java/hudson/tasks/JavadocArchiverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ public void doNotKeepAll() throws Exception {
public void keepAllInPipeline() throws Exception {
WorkflowJob job = r.createProject(WorkflowJob.class);
job.setDefinition(new CpsFlowDefinition(
"node {\n"
+ " writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'\n"
+ " javadoc javadocDir: 'doc', keepAll: true\n"
+ "}",
"""
node {
writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'
javadoc javadocDir: 'doc', keepAll: true
}
""",
true));

WorkflowRun b1 = r.buildAndAssertSuccess(job);
Expand All @@ -119,10 +121,12 @@ public void keepAllInPipeline() throws Exception {
public void doNotKeepAllInPipeline() throws Exception {
WorkflowJob job = r.createProject(WorkflowJob.class);
job.setDefinition(new CpsFlowDefinition(
"node {\n"
+ " writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'\n"
+ " javadoc javadocDir: 'doc', keepAll: false\n"
+ "}",
"""
node {
writeFile text: 'generated by #'+env.BUILD_NUMBER, file: 'doc/index.html'
javadoc javadocDir: 'doc', keepAll: false
}
""",
true));

WorkflowRun b1 = r.buildAndAssertSuccess(job);
Expand Down
Loading