Skip to content

Commit

Permalink
Merge pull request #26 from AayushSaini101/Modernize_plugin
Browse files Browse the repository at this point in the history
Modernize the plugin to java 11
  • Loading branch information
MarkEWaite authored Sep 7, 2022
2 parents 7377b7b + b471a5a commit 2e98a70
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
8 changes: 8 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/groovy

buildPlugin(failFast: false,
configurations: [
[platform: 'linux', jdk: '17', jenkins: '2.346.1'],
[platform: 'linux', jdk: '11'],
[platform: 'windows', jdk: '8'],
])
40 changes: 18 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.5</version>
<version>4.47</version>
<relativePath />
</parent>
<groupId>org.jvnet.hudson.tools</groupId>
Expand All @@ -14,17 +14,7 @@
<packaging>hpi</packaging>

<properties>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<jenkins.version>1.625.3</jenkins.version>
<!-- Java Level to use. Java 7 required when using core >= 1.612 -->
<java.level>7</java.level>
<!-- Jenkins Test Harness version you use to test the plugin. -->
<!-- For Jenkins version >= 1.580.1 use JTH 2.x or higher. -->
<jenkins-test-harness.version>2.1</jenkins-test-harness.version>
<!-- Other properties you may want to use:
~ hpi-plugin.version: The HPI Maven Plugin version used by the plugin..
~ stapler-plugin.version: The Stapler Maven plugin version required by the plugin.
-->
<jenkins.version>2.332.4</jenkins.version>
</properties>

<name>Version Number Plug-In</name>
Expand Down Expand Up @@ -89,32 +79,38 @@
</pluginRepository>
</pluginRepositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.332.x</artifactId>
<version>1607.va_c1576527071</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<!-- If you want to depend on other plugins: -->
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
<version>1.15</version>
</dependency>
<!-- Testing scope -->
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-aggregator</artifactId>
<version>1.14</version>
<artifactId>workflow-cps</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-support</artifactId>
<version>1.14</version>
<classifier>tests</classifier>
<artifactId>workflow-job</artifactId>
<scope>test</scope>
</dependency>
<!-- Required by workflow-cps-global-lib (transitive of git-server) -->
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>sshd</artifactId>
<version>1.6</version>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-basic-steps</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public static String formatVersionNumber(String versionNumberFormatString,
else {
LOGGER.fine("Special case: A variable could not be resolved. (Does it resolve to itself?)" +
" [var == " + expressionKey + "]");
if (enVars != null) {

for (Map.Entry entry : enVars.entrySet()) {
if (entry.getKey().equals(expressionKey)) {
// Check for variable which resolves to itself!
Expand All @@ -195,7 +195,7 @@ public static String formatVersionNumber(String versionNumberFormatString,
replaceValue = selectSubstringOfReplaceValue(replaceValue, argumentString);
}
}
}

}
}
vnf = vnf.substring(0, blockStart) + replaceValue + vnf.substring(blockEnd, vnf.length());
Expand Down

0 comments on commit 2e98a70

Please sign in to comment.