Bump parent pom to 45
diff --git a/pom.xml b/pom.xml
index 3b8aace..b5f7db1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
- <version>43</version>
+ <version>45</version>
<relativePath />
</parent>
@@ -72,6 +72,8 @@
<mavenVersion>3.6.3</mavenVersion>
<jacocoVersion>0.8.14</jacocoVersion>
<project.build.outputTimestamp>2024-09-03T16:36:13Z</project.build.outputTimestamp>
+
+ <version.maven-invoker-plugin>3.9.1</version.maven-invoker-plugin>
</properties>
<dependencies>
@@ -102,6 +104,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
+ <version>${version.maven-plugin-tools}</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -110,6 +113,10 @@
<version>3.4.2</version>
</dependency>
<dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-xml</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-sec-dispatcher</artifactId>
<version>1.4</version>
diff --git a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoParallelTest.java b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoParallelTest.java
index 47aff1c..130156b 100644
--- a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoParallelTest.java
+++ b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoParallelTest.java
@@ -46,11 +46,17 @@
import static org.apache.maven.plugins.jarsigner.TestJavaToolResults.RESULT_OK;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.ArgumentMatchers.isA;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
public class JarsignerSignMojoParallelTest {
@Rule
diff --git a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoRetryTest.java b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoRetryTest.java
index feba11c..80b54ec 100644
--- a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoRetryTest.java
+++ b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoRetryTest.java
@@ -45,7 +45,8 @@
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.Mockito.argThat;
@@ -143,7 +144,7 @@
}
@Test
- public void testInvalidMaxTries_zero() throws Exception {
+ public void testInvalidMaxTriesZero() throws Exception {
when(jarSigner.execute(any(JarSignerSignRequest.class))).thenReturn(RESULT_ERROR);
configuration.put("maxTries", "0"); // Setting an "invalid" value
@@ -161,7 +162,7 @@
}
@Test
- public void testInvalidMaxTries_negative() throws Exception {
+ public void testInvalidMaxTriesNegative() throws Exception {
// Make result ok, to make this test check more things (compared to testInvalidMaxTries_zero())
when(jarSigner.execute(any(JarSignerSignRequest.class))).thenReturn(RESULT_OK);
@@ -195,7 +196,7 @@
}
@Test
- public void testInvalidMaxRetryDelaySeconds_negative() throws Exception {
+ public void testInvalidMaxRetryDelaySecondsNegative() throws Exception {
when(jarSigner.execute(any(JarSignerSignRequest.class)))
.thenReturn(RESULT_ERROR)
.thenReturn(RESULT_OK);
@@ -217,16 +218,16 @@
public void testDefaultWaitStrategy() throws Exception {
JarsignerSignMojo mojo = mojoTestCreator.configure(configuration);
- long NO_SLEEP_VALUE = 42_001;
+ long noSleepValue = 42_001;
// Storage of the most recent sleep value
- AtomicLong sleepValue = new AtomicLong(NO_SLEEP_VALUE);
+ AtomicLong sleepValue = new AtomicLong(noSleepValue);
Sleeper sleeper = value -> sleepValue.set(value);
mojo.waitAfterFailure(0, Duration.ofSeconds(0), sleeper);
- assertEquals(NO_SLEEP_VALUE, sleepValue.get());
+ assertEquals(noSleepValue, sleepValue.get());
mojo.waitAfterFailure(1, Duration.ofSeconds(0), sleeper);
- assertEquals(NO_SLEEP_VALUE, sleepValue.get());
+ assertEquals(noSleepValue, sleepValue.get());
mojo.waitAfterFailure(0, Duration.ofSeconds(1), sleeper);
assertEquals(1000, sleepValue.get());
@@ -243,10 +244,10 @@
mojo.waitAfterFailure(Integer.MAX_VALUE, Duration.ofSeconds(100), sleeper);
assertEquals(100_000, sleepValue.get());
- sleepValue.set(NO_SLEEP_VALUE); // "reset" sleep value
+ sleepValue.set(noSleepValue); // "reset" sleep value
mojo.waitAfterFailure(Integer.MIN_VALUE, Duration.ofSeconds(100), sleeper);
// Make sure sleep has not been invoked, should be the "reset" value
- assertEquals(NO_SLEEP_VALUE, sleepValue.get());
+ assertEquals(noSleepValue, sleepValue.get());
// Testing the attempt limit used in exponential function. Will return a odd value (2^20).
mojo.waitAfterFailure(10000, Duration.ofDays(356), sleeper);
diff --git a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTest.java b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTest.java
index 0c62e11..beb96ab 100644
--- a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTest.java
@@ -51,7 +51,11 @@
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
diff --git a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTsaTest.java b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTsaTest.java
index 80a0ced..df7fdba 100644
--- a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTsaTest.java
+++ b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojoTsaTest.java
@@ -42,7 +42,7 @@
import static org.apache.maven.plugins.jarsigner.TestJavaToolResults.RESULT_OK;
import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.Mockito.mock;
diff --git a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerVerifyMojoTest.java b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerVerifyMojoTest.java
index dc5fa3a..eb79d31 100644
--- a/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerVerifyMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/jarsigner/JarsignerVerifyMojoTest.java
@@ -40,7 +40,10 @@
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.mock;
diff --git a/src/test/java/org/apache/maven/plugins/jarsigner/TsaSelectorTest.java b/src/test/java/org/apache/maven/plugins/jarsigner/TsaSelectorTest.java
index f224f76..b1fb5f7 100644
--- a/src/test/java/org/apache/maven/plugins/jarsigner/TsaSelectorTest.java
+++ b/src/test/java/org/apache/maven/plugins/jarsigner/TsaSelectorTest.java
@@ -28,7 +28,8 @@
import org.apache.maven.plugins.jarsigner.TsaSelector.TsaServer;
import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
public class TsaSelectorTest {
private static final String[] EMPTY = new String[0];