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

Modernize the plugin #49

Merged
merged 3 commits into from
Dec 4, 2024
Merged
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
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/jenkins-infra/pipeline-library/
*/
buildPlugin(useContainerAgent: true, configurations: [
[ platform: 'linux', jdk: '11' ],
[ platform: 'windows', jdk: '11' ],
[ platform: 'windows', jdk: '17' ],
[ platform: 'linux', jdk: '17' ],
[ platform: 'linux', jdk: '21' ],
])
172 changes: 87 additions & 85 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,98 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>4.88</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>5.3</version>
<relativePath />
</parent>
<groupId>org.jenkinsci.plugins</groupId>
<artifactId>change-assembly-version-plugin</artifactId>
<version>${revision}${changelist}</version>
<packaging>hpi</packaging>

<properties>
<revision>1.11</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/change-assembly-version-plugin</gitHubRepo>
<jenkins.version>2.361.4</jenkins.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.failOnError>false</spotbugs.failOnError>
<spotbugs.threshold>Low</spotbugs.threshold>
</properties>
<url>https://wiki.jenkins-ci.org/display/JENKINS/Change+Assembly+Version</url>

<scm>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:ssh://[email protected]/${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>
<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/MIT</url>
</license>
</licenses>

<developers>
<developer>
<id>slide</id>
<name>Alex Earl</name>
<email>[email protected]</email>
</developer>
</developers>
<developers>
<developer>
<id>slide</id>
<name>Alex Earl</name>
<email>[email protected]</email>
</developer>
</developers>

<url>https://wiki.jenkins-ci.org/display/JENKINS/Change+Assembly+Version</url>
<groupId>org.jenkinsci.plugins</groupId>
<artifactId>change-assembly-version-plugin</artifactId>
<version>${revision}${changelist}</version>
<packaging>hpi</packaging>
<scm>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
<tag>${scmTag}</tag>
<url>https://github.com/${gitHubRepo}</url>
</scm>

<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/MIT</url>
</license>
</licenses>
<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>

<properties>
<revision>1.11</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/change-assembly-version-plugin</gitHubRepo>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.failOnError>false</spotbugs.failOnError>
<spotbugs.threshold>Low</spotbugs.threshold>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.479.x</artifactId>
<version>3761.vd922730f0fd2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.361.x</artifactId>
<version>2102.v854b_fec19c92</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
</dependencyManagement>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
<scope>test</scope>
</dependency>
</dependencies>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<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>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,24 @@
import hudson.EnvVars;
import hudson.model.BuildListener;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import hudson.model.BuildListener;

public class AssemblyVersion {


private String version;
private EnvVars envVars;
private BuildListener listener;

/**
* The instance of this class gonna return in the property version the value to be used on ChangeTools.
* @param version
* @param envVars
*/
public AssemblyVersion(String version, EnvVars envVars){
this.envVars = envVars;

this.version = envVars.expand(version);
}

public String getVersion(){
return this.version;
}

private String version;
private EnvVars envVars;
private BuildListener listener;

/**
* The instance of this class gonna return in the property version the value to be used on ChangeTools.
* @param version
* @param envVars
*/
public AssemblyVersion(String version, EnvVars envVars) {
this.envVars = envVars;

this.version = envVars.expand(version);
}

public String getVersion() {
return this.version;
}
}
Loading
Loading