Skip to content

Commit

Permalink
Merge pull request #9 from lacostej/fix/upgrade_dependencies
Browse files Browse the repository at this point in the history
Upgrade POM (parent POM, minimum jenkins version, etc)
  • Loading branch information
lacostej authored Oct 31, 2023
2 parents 1b92e17 + f22302a commit 6b8e139
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 16 deletions.
14 changes: 10 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env groovy

/* `buildPlugin` step provided by: https://github.com/jenkins-infra/pipeline-library */
buildPlugin()
/*
See the documentation for more options:
https://github.com/jenkins-infra/pipeline-library/
*/
buildPlugin(
useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
])
63 changes: 54 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.9</version>
<version>4.75</version> <!-- See https://github.com/jenkinsci/plugin-pom/releases for available versions-->
<relativePath />
</parent>

<artifactId>batch-task</artifactId>
Expand All @@ -14,10 +15,12 @@
<url>http://wiki.jenkins-ci.org/display/JENKINS/Batch+Task+Plugin</url>

<properties>
<jenkins.version>1.580.1</jenkins.version>
<java.level>6</java.level>
<powermock.version>1.6.1</powermock.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<!-- remember to change the io.jenkins.tools.bom artifact when changing this -->
<jenkins.version>2.387.3</jenkins.version>
<!--powermock.version>1.6.1</powermock.version-->
<findbugs.failOnError>false</findbugs.failOnError>
<jenkins-test-harness.version>2099.vc95b_86578f37</jenkins-test-harness.version>
</properties>

<developers>
Expand All @@ -32,20 +35,62 @@
</developers>

<scm>
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:[email protected]:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<url>http://github.com/jenkinsci/${project.artifactId}-plugin</url>
<tag>HEAD</tag>
</scm>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.lib</groupId>
<artifactId>envinject-lib</artifactId>
<version>1.24</version>
</dependency>
<dependency>
<groupId>io.jenkins</groupId>
<artifactId>configuration-as-code</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.configuration-as-code</groupId>
<artifactId>test-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-basic-steps</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-durable-task-step</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.387.x</artifactId>
<version>2143.ve4c3c9ec790a</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/hudson/plugins/batch_task/BatchTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import hudson.model.Job;
import hudson.model.queue.CauseOfBlockage;
import hudson.model.queue.SubTask;
import hudson.security.AccessControlled;
import hudson.util.Iterators;
import hudson.widgets.BuildHistoryWidget;
import hudson.widgets.HistoryWidget;
Expand Down Expand Up @@ -44,7 +45,7 @@
*
* @author Kohsuke Kawaguchi
*/
public final class BatchTask extends AbstractModelObject implements Queue.Task {
public final class BatchTask extends AbstractModelObject implements Queue.Task, AccessControlled {
/**
* Name of this task. Used for display.
*/
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/hudson/plugins/batch_task/BatchTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package hudson.plugins.batch_task;

import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.htmlunit.html.HtmlPage;

import hudson.Functions;
import hudson.Util;
Expand Down Expand Up @@ -89,7 +89,6 @@ public void testExecute() throws Exception {
"echo \"$TASK_ID:$GLOBAL:$OVERRIDE_ME:$HUDSON_USER\"\n");
}
p.addProperty(new BatchTaskProperty(task));
p.scheduleBuild2(0);
FreeStyleBuild freeStyleBuild = p.scheduleBuild2(0).get();
while (freeStyleBuild.isBuilding()) {
Thread.sleep(100);
Expand Down

0 comments on commit 6b8e139

Please sign in to comment.