This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/tomcat-maven-plugin.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 71d134f  Cleanups
71d134f is described below

commit 71d134fff5f2309afc6e5ba93c0fbc348d2cfaac
Author: remm <[email protected]>
AuthorDate: Fri Apr 17 13:32:11 2026 +0200

    Cleanups
---
 .../run/DefaultClassLoaderEntriesCalculator.java   |  2 +-
 .../maven/common/run/TomcatRunException.java       |  2 ++
 .../plugin/tomcat/run/AbstractExecWarMojo.java     | 10 ++++-----
 .../maven/plugin/tomcat/run/AbstractRunMojo.java   |  3 +--
 .../tomcat/run/AbstractStandaloneWarMojo.java      |  2 +-
 .../apache/tomcat/maven/runner/TomcatRunner.java   | 24 ++++++++++------------
 6 files changed, 21 insertions(+), 22 deletions(-)

diff --git 
a/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
 
b/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
index 12b9957..4eaf05c 100644
--- 
a/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
+++ 
b/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
@@ -69,7 +69,7 @@ public class DefaultClassLoaderEntriesCalculator
         // add classes directories to loader
         try
         {
-            @SuppressWarnings( "unchecked" ) List<String> classPathElements = 
request.isUseTestClassPath()
+            List<String> classPathElements = request.isUseTestClassPath()
                 ? request.getMavenProject().getTestClasspathElements()
                 : request.getMavenProject().getRuntimeClasspathElements();
             if ( classPathElements != null )
diff --git 
a/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java 
b/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java
index 537e92e..08751bd 100644
--- a/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java
+++ b/src/main/java/org/apache/tomcat/maven/common/run/TomcatRunException.java
@@ -26,6 +26,8 @@ package org.apache.tomcat.maven.common.run;
 public class TomcatRunException
     extends Exception
 {
+    private static final long serialVersionUID = 1L;
+
     public TomcatRunException( String s, Throwable throwable )
     {
         super( s, throwable );
diff --git 
a/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractExecWarMojo.java
 
b/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractExecWarMojo.java
index d9c8b85..157d966 100644
--- 
a/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractExecWarMojo.java
+++ 
b/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractExecWarMojo.java
@@ -239,7 +239,7 @@ public abstract class AbstractExecWarMojo
         File execWarJar = new File( buildDirectory, finalName );
 
         FileOutputStream execWarJarOutputStream = null;
-        ArchiveOutputStream os = null;
+        ArchiveOutputStream<JarArchiveEntry> os = null;
         File tmpPropertiesFile = null;
         File tmpManifestFile = null;
         FileOutputStream tmpPropertiesFileOutputStream = null;
@@ -318,7 +318,7 @@ public abstract class AbstractExecWarMojo
                             version = findArtifactVersion( dependency );
                         }
 
-if ( version == null || version.isEmpty() )
+                        if ( version == null || version.isEmpty() )
                         {
                             throw new MojoExecutionException(
                                 "Dependency '" + dependency.getGroupId() + 
"':'" + dependency.getArtifactId()
@@ -535,7 +535,7 @@ if ( version == null || version.isEmpty() )
     }
 
     protected void copyDirectoryContentIntoArchive( File sourceFolder, String 
destinationPath,
-                                                    ArchiveOutputStream 
archiveOutputStream )
+                                                    
ArchiveOutputStream<JarArchiveEntry> archiveOutputStream )
         throws IOException
     {
 
@@ -609,7 +609,7 @@ if ( version == null || version.isEmpty() )
     protected File addContextXmlToWar( File contextXmlFile, File warFile )
         throws IOException, ArchiveException
     {
-        ArchiveOutputStream os = null;
+        ArchiveOutputStream<JarArchiveEntry> os = null;
         OutputStream warOutputStream = null;
         File tmpWar = Files.createTempFile( "tomcat", "war-exec" ).toFile();
         tmpWar.deleteOnExit();
@@ -641,7 +641,7 @@ if ( version == null || version.isEmpty() )
      * @param os   The output archive
      * @throws IOException
      */
-    protected void extractJarToArchive( JarFile file, ArchiveOutputStream os, 
String[] excludes )
+    protected void extractJarToArchive( JarFile file, 
ArchiveOutputStream<JarArchiveEntry> os, String[] excludes )
         throws IOException
     {
         Enumeration<? extends JarEntry> entries = file.entries();
diff --git 
a/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractRunMojo.java 
b/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractRunMojo.java
index 06a9109..adc33fb 100644
--- 
a/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractRunMojo.java
+++ 
b/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractRunMojo.java
@@ -1314,7 +1314,6 @@ public abstract class AbstractRunMojo
         }
     }
 
-    @SuppressWarnings( "unchecked" )
     public Set<Artifact> getProjectArtifacts()
     {
         return project.getArtifacts();
@@ -1383,7 +1382,7 @@ public abstract class AbstractRunMojo
         List<Context> contexts = new ArrayList<Context>();
 
         ScopeArtifactFilter filter = new ScopeArtifactFilter( "tomcat" );
-        @SuppressWarnings( "unchecked" ) Set<Artifact> artifacts = 
project.getArtifacts();
+        Set<Artifact> artifacts = project.getArtifacts();
         for ( Artifact artifact : artifacts )
         {
 
diff --git 
a/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractStandaloneWarMojo.java
 
b/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractStandaloneWarMojo.java
index 3d1f823..4c68d38 100644
--- 
a/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractStandaloneWarMojo.java
+++ 
b/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/AbstractStandaloneWarMojo.java
@@ -93,7 +93,7 @@ public abstract class AbstractStandaloneWarMojo
         File execWarJar = new File( buildDirectory, finalName );
 
         FileOutputStream execWarJarOutputStream = null;
-        ArchiveOutputStream os = null;
+        ArchiveOutputStream<JarArchiveEntry> os = null;
         File tmpPropertiesFile = null;
         File tmpManifestFile = null;
         FileOutputStream tmpPropertiesFileOutputStream = null;
diff --git a/src/main/java/org/apache/tomcat/maven/runner/TomcatRunner.java 
b/src/main/java/org/apache/tomcat/maven/runner/TomcatRunner.java
index 14fa46a..e95aa34 100644
--- a/src/main/java/org/apache/tomcat/maven/runner/TomcatRunner.java
+++ b/src/main/java/org/apache/tomcat/maven/runner/TomcatRunner.java
@@ -18,17 +18,6 @@ package org.apache.tomcat.maven.runner;
  * under the License.
  */
 
-import org.apache.catalina.Context;
-import org.apache.catalina.Host;
-import org.apache.catalina.connector.Connector;
-import org.apache.catalina.startup.Catalina;
-import org.apache.catalina.startup.ContextConfig;
-import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.valves.AccessLogValve;
-import org.apache.juli.ClassLoaderLogManager;
-import org.apache.tomcat.util.ExceptionUtils;
-import org.apache.tomcat.util.http.fileupload.FileUtils;
-
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -36,8 +25,6 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.AccessController;
@@ -48,6 +35,17 @@ import java.util.Properties;
 import java.util.StringTokenizer;
 import java.util.logging.LogManager;
 
+import org.apache.catalina.Context;
+import org.apache.catalina.Host;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.startup.Catalina;
+import org.apache.catalina.startup.ContextConfig;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.valves.AccessLogValve;
+import org.apache.juli.ClassLoaderLogManager;
+import org.apache.tomcat.util.ExceptionUtils;
+import org.apache.tomcat.util.http.fileupload.FileUtils;
+
 /**
  * FIXME add junit for that but when 
https://issues.apache.org/bugzilla/show_bug.cgi?id=52028 fixed
  * Main class used to run the standalone wars in a Apache Tomcat instance.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to