diff --git a/pom.xml b/pom.xml index 71d49df..34f8ea2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,13 +4,13 @@ org.jenkins-ci.plugins plugin - 4.17 + 4.33 999999-SNAPSHOT - jenkinsci/token-macro-plugin + jenkinsci/${project.artifactId}-plugin 2.289.1 8 @@ -18,7 +18,7 @@ The MIT License (MIT) - http://opensource.org/licenses/MIT + https://opensource.org/licenses/MIT repo @@ -28,7 +28,7 @@ hpi Token Macro Plugin This plugin adds reusable macro expansion capability for other plugins to use. - https://github.com/jenkinsci/token-macro-plugin + https://github.com/jenkinsci/${project.artifactId}-plugin @@ -82,12 +82,17 @@ com.jayway.jsonpath json-path - 2.6.0 + 2.7.0 org.ow2.asm asm + + + org.slf4j + slf4j-api + @@ -129,7 +134,6 @@ org.jenkins-ci.plugins.workflow workflow-basic-steps - 2.23 test @@ -147,39 +151,14 @@ org.jenkinsci.plugins pipeline-model-definition - 1.8.1 test org.mockito mockito-core - 3.8.0 test - - - hamcrest-core - org.hamcrest - - - - - - - maven-javadoc-plugin - 3.3.1 - - true - - http://javadoc.jenkins.io/ - - - 8 - - - - diff --git a/src/main/java/org/jenkinsci/plugins/tokenmacro/MacroEvaluationException.java b/src/main/java/org/jenkinsci/plugins/tokenmacro/MacroEvaluationException.java index ffac9f7..1f70bf3 100644 --- a/src/main/java/org/jenkinsci/plugins/tokenmacro/MacroEvaluationException.java +++ b/src/main/java/org/jenkinsci/plugins/tokenmacro/MacroEvaluationException.java @@ -23,8 +23,8 @@ */ package org.jenkinsci.plugins.tokenmacro; -import javax.annotation.CheckForNull; -import javax.annotation.Nonnull; +import edu.umd.cs.findbugs.annotations.CheckForNull; +import edu.umd.cs.findbugs.annotations.NonNull; /** * Signals that the evaluation of the macro has failed, and the error should be presented to users @@ -36,15 +36,15 @@ public class MacroEvaluationException extends Exception { private final @CheckForNull String macroName; - public MacroEvaluationException(@Nonnull String message) { + public MacroEvaluationException(@NonNull String message) { this(message, null, null); } - public MacroEvaluationException(@Nonnull String message, @CheckForNull Throwable cause) { + public MacroEvaluationException(@NonNull String message, @CheckForNull Throwable cause) { this(message, null, cause); } - public MacroEvaluationException(@CheckForNull String message, @Nonnull String macroName) { + public MacroEvaluationException(@CheckForNull String message, @NonNull String macroName) { this(message, macroName, null); } diff --git a/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java b/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java index 8de2377..cfe3a47 100644 --- a/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java +++ b/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java @@ -41,8 +41,8 @@ import java.io.IOException; -import javax.annotation.CheckForNull; -import javax.annotation.Nonnull; +import edu.umd.cs.findbugs.annotations.CheckForNull; +import edu.umd.cs.findbugs.annotations.NonNull; import jenkins.model.Jenkins; @@ -244,8 +244,8 @@ public static String expandAll(Run run, FilePath workspace, TaskListener li * @return Retrieved workspace * @throws MacroEvaluationException Workspace is inaccessible */ - @Nonnull - protected static FilePath getWorkspace(@Nonnull AbstractBuild context) + @NonNull + protected static FilePath getWorkspace(@NonNull AbstractBuild context) throws MacroEvaluationException { final FilePath workspace = context.getWorkspace(); if (workspace == null) { @@ -267,7 +267,7 @@ protected static FilePath getWorkspace(@Nonnull AbstractBuild context) * @return the previous run, or null if that run is missing, or is still in progress */ @CheckForNull - public static Run getPreviousRun(@Nonnull Run run, TaskListener listener) { + public static Run getPreviousRun(@NonNull Run run, TaskListener listener) { Run previousRun = run.getPreviousBuild(); if (previousRun != null && previousRun.isBuilding()) { listener.getLogger().println(Messages.TokenMacro_Run_still_in_progress(previousRun.getDisplayName())); diff --git a/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacroStep.java b/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacroStep.java index 4a6d8cf..c3f5238 100644 --- a/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacroStep.java +++ b/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacroStep.java @@ -8,17 +8,17 @@ import org.jenkinsci.plugins.workflow.steps.*; import org.kohsuke.stapler.DataBoundConstructor; -import javax.annotation.Nonnull; +import edu.umd.cs.findbugs.annotations.NonNull; import java.util.Collections; import java.util.HashSet; import java.util.Set; public class TokenMacroStep extends Step { - private final @Nonnull String stringWithMacro; + private final @NonNull String stringWithMacro; @DataBoundConstructor - public TokenMacroStep(@Nonnull String stringWithMacro) { + public TokenMacroStep(@NonNull String stringWithMacro) { this.stringWithMacro = stringWithMacro; } diff --git a/src/main/java/org/jenkinsci/plugins/tokenmacro/Transform.java b/src/main/java/org/jenkinsci/plugins/tokenmacro/Transform.java index b4c92b5..28fb4f4 100644 --- a/src/main/java/org/jenkinsci/plugins/tokenmacro/Transform.java +++ b/src/main/java/org/jenkinsci/plugins/tokenmacro/Transform.java @@ -1,10 +1,10 @@ package org.jenkinsci.plugins.tokenmacro; -import javax.annotation.Nonnull; +import edu.umd.cs.findbugs.annotations.NonNull; /** * Created by acearl on 2/24/2016. */ public abstract class Transform { - public abstract String transform (@Nonnull String input) throws MacroEvaluationException; + public abstract String transform (@NonNull String input) throws MacroEvaluationException; } diff --git a/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/AdminEmailMacro.java b/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/AdminEmailMacro.java index 4720230..1b491ca 100644 --- a/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/AdminEmailMacro.java +++ b/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/AdminEmailMacro.java @@ -20,7 +20,7 @@ import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; import org.jenkinsci.plugins.tokenmacro.TokenMacro; -import javax.annotation.Nonnull; +import edu.umd.cs.findbugs.annotations.NonNull; /** * @@ -51,7 +51,7 @@ public String evaluate(Run run, FilePath workspace, TaskListener listener, return getAdminAddress(); } - @Nonnull + @NonNull public String getAdminAddress() throws MacroEvaluationException { JenkinsLocationConfiguration configuration = JenkinsLocationConfiguration.get(); if (configuration == null) { diff --git a/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/UpstreamRunNameMacro.java b/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/UpstreamRunNameMacro.java index 0a59927..daa2e8f 100644 --- a/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/UpstreamRunNameMacro.java +++ b/src/main/java/org/jenkinsci/plugins/tokenmacro/impl/UpstreamRunNameMacro.java @@ -6,7 +6,7 @@ import org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro; import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; -import javax.annotation.Nonnull; +import edu.umd.cs.findbugs.annotations.NonNull; import java.io.IOException; import java.util.Collections; import java.util.List; @@ -47,7 +47,7 @@ public String evaluate(Run run, FilePath workspace, TaskListener listener, return "Unknown"; } - @Nonnull + @NonNull @SuppressFBWarnings private Run getUpstreamRun(Cause.UpstreamCause cause) throws MacroEvaluationException { if(cause.getUpstreamRun() == null) diff --git a/src/main/java/org/jenkinsci/plugins/tokenmacro/transform/SubstringTransform.java b/src/main/java/org/jenkinsci/plugins/tokenmacro/transform/SubstringTransform.java index 712e93f..fd1762d 100644 --- a/src/main/java/org/jenkinsci/plugins/tokenmacro/transform/SubstringTransform.java +++ b/src/main/java/org/jenkinsci/plugins/tokenmacro/transform/SubstringTransform.java @@ -3,7 +3,7 @@ import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException; import org.jenkinsci.plugins.tokenmacro.Transform; -import javax.annotation.Nonnull; +import edu.umd.cs.findbugs.annotations.NonNull; /** * Created by acearl on 2/25/2016. @@ -19,7 +19,7 @@ public SubstringTransform(int offset, int length) { } @Override - public String transform(@Nonnull String input) throws MacroEvaluationException { + public String transform(@NonNull String input) throws MacroEvaluationException { if(offset > input.length()) { throw new MacroEvaluationException(String.format("Offset given (%d) is larger than the string", offset)); }