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

Update to the latest jenkins plugin version 4.8 #50

Closed
wants to merge 12 commits into from
Closed
4 changes: 2 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The MIT License

Copyright (c) 2020-, Frank Ittermann
Copyright (c) 2013-, Magnus Sandberg
Copyright (c) 2010-, Brad Larson

Expand All @@ -15,9 +16,8 @@ all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
DOCKER_COMMAND=docker run -it --rm --name priority-sorter -v $(PWD):/usr/src/priority-sorter -v "${HOME}/.m2":/root/.m2 --env-file ./maven.env -w /usr/src/priority-sorter maven:3-jdk-8

build: ## build priority sorter plugn
$(DOCKER_COMMAND) mvn install

plugin: ## create jenkins plugin archetype skeleton
$(DOCKER_COMMAND) mvn archetype:generate -Dfilter="io.jenkins.archetypes:"

test-coverage: clean ## package priority sorter plugin
$(DOCKER_COMMAND) mvn -P enable-jacoco -Dmaven.spotbugs.skip=true test verify

test: clean ## package priority sorter plugin
$(DOCKER_COMMAND) mvn -Dmaven.spotbugs.skip=true test

test-only: clean ## package priority sorter plugin
$(DOCKER_COMMAND) mvn -Djava.util.logging.config.file=./src/test/resources/logging.properties -Dtest=$(TEST_NAME) -Dmaven.spotbugs.skip=true test

package: clean ## package priority sorter plugin
$(DOCKER_COMMAND) mvn -P quick-build -Xlint:all -Dmaven.spotbugs.skip=true -Dmaven.test.skip=true versions:use-latest-versions package
cat target/classes/META-INF/annotations/hudson.Extension.txt

clean:
# delete all target foldes except jenkins-for-test reduce test time by 80 seconds
@bash -c $$'cd target; shopt -s extglob\nrm -rf !("jenkins-for-test"); cd ..'

spotbugs: ## package priority sorter plugin
$(DOCKER_COMMAND) mvn -Dmaven.test.skip=true install spotbugs:check
#spotbugs:gui
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

[![Build Status](https://ci.jenkins.io/buildStatus/icon?job=Plugins%2Fpriority-sorter-plugin%2Fmaster)](https://ci.jenkins.io/job/Plugins/job/priority-sorter-plugin/job/master/)

# Jenkins Priority Sorter Plugin

This plugin adds the ability to assign different priorities to Jobs, the lower priority the job has the sooner the Job will run.
Expand Down
1 change: 1 addition & 0 deletions maven.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAVEN_OPTS=-XX:+TieredCompilation -XX:TieredStopAtLevel=1
113 changes: 49 additions & 64 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.580</version>
</parent>
<artifactId>PrioritySorter</artifactId>
<version>3.6.1-SNAPSHOT</version>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.8</version>
<relativePath />
</parent>
<properties>
<jenkins.version>2.235.1</jenkins.version>
<java.level>8</java.level>
</properties>
<artifactId>PrioritySorter</artifactId>
<version>4.0.1-SNAPSHOT</version>
<packaging>hpi</packaging>
<name>Jenkins Priority Sorter Plugin</name>
<description>This plugin allows for the build queue to be sorted based on configurable Sorting and Priority Assigment Strategies.</description>
Expand All @@ -17,93 +22,86 @@
<name>MIT</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<comments>
Copyright 2020- Frank Ittermann. All rights reserved.
Copyright 2013- Magnus Sandberg. All rights reserved.
Copyright 2010- Brad Larson. All rights reserved.
</comments>
</license>
</licenses>

<developers>
<developer>
<id>emsa23</id>
<name>Magnus Sandberg</name>
<email>emsa@switchbeat.com</email>
<roles>
<role>developer</role>
<role>maintainer</role>
</roles>
<timezone>CET</timezone>
</developer>
<!-- Removed not to show on Wiki <developer> <id>bklarson</id> <name>Brad
Larson</name> <email>bklarson@gmail.com</email> <roles> <role>developer</role>
<role>retired maintainer</role> </roles> <timezone>-6</timezone> </developer> -->
</developers>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.235.x</artifactId>
<version>12</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<compatibleSinceVersion>3.1</compatibleSinceVersion>
</configuration>
</plugin>
<!-- http://stackoverflow.com/questions/15166781/mvn-releaseprepare-not-committing-changes-to-pom-xml -->
<plugin>
<artifactId>maven-release-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
<allowSnapshots>false</allowSnapshots>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-project</artifactId>
<version>1.4</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>cloudbees-folder</artifactId>
<version>5.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.synopsys.arc.jenkinsci.plugins</groupId>
<artifactId>job-restrictions</artifactId>
<version>0.4</version>
<version>0.8</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-durable-task-step</artifactId>
<version>2.4</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>sectioned-view</artifactId>
<version>1.18</version>
<version>1.25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>nested-view</artifactId>
<version>1.14</version>
<version>1.17</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1.22</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -121,19 +119,6 @@
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<!--TODO: temporary hack, remove after the upgrade of Parent POM-->
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>maven.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/releases/</url>
</repository>
<snapshotRepository>
<id>maven.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<scm>
<connection>scm:git:git://github.com/jenkinsci/priority-sorter-plugin.git</connection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.annotation.Nonnull;

import jenkins.advancedqueue.sorter.ItemInfo;
import jenkins.model.Jenkins;

/**
* @author Magnus Sandberg
Expand Down
Loading