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 a693959  Simplify
a693959 is described below

commit a693959f6ae3e8c9d1a5af13bd50faa7c34f258c
Author: remm <[email protected]>
AuthorDate: Thu Apr 9 15:03:15 2026 +0200

    Simplify
---
 .../tomcat/maven/plugin/tomcat/run/RunMojo.java    | 71 +---------------------
 1 file changed, 1 insertion(+), 70 deletions(-)

diff --git 
a/tomcat-main-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/RunMojo.java
 
b/tomcat-main-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/RunMojo.java
index 57de531..5203af3 100644
--- 
a/tomcat-main-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/RunMojo.java
+++ 
b/tomcat-main-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat/run/RunMojo.java
@@ -300,74 +300,6 @@ public class RunMojo
         return loader;
     }
 
-    protected static class MyDirContext extends StandardRoot {
-        String buildOutputDirectory;
-
-        String webAppPath;
-
-        WebResourceSet webResourceSet;
-
-        Log log;
-
-        MyDirContext(String buildOutputDirectory, String webAppPath, Log log) {
-
-            this.buildOutputDirectory = buildOutputDirectory;
-            this.webAppPath = webAppPath;
-            this.log = log;
-        }
-
-        @Override
-        public WebResource getResource(String path) {
-
-            log.debug("MyDirContext#getResource: " + path);
-            if ("/WEB-INF/classes".equals(path)) {
-                return new FileResource(this, this.webAppPath, new 
File(this.buildOutputDirectory), true, null);
-            }
-
-            File file = new File(path);
-            if (file.exists()) {
-                return new FileResource(this, this.webAppPath, file, true, 
null);
-            }
-            WebResource webResource = super.getResource(path);
-            return webResource;
-        }
-
-
-        @Override
-        public WebResource getClassLoaderResource(String path) {
-            log.debug("MyDirContext#getClassLoaderResource: " + path);
-            // here get resources from various paths
-            return super.getClassLoaderResource(path);
-        }
-
-
-        @Override
-        public WebResource[] listResources(String path) {
-            log.debug("MyDirContext#listResources: " + path);
-            return super.listResources(path);
-        }
-
-        @Override
-        public WebResource[] getClassLoaderResources(String path) {
-            log.debug("MyDirContext#getClassLoaderResources: " + path);
-            return super.getClassLoaderResources(path);
-        }
-
-        @Override
-        public WebResource[] getResources(String path) {
-            log.debug("MyDirContext#getResources: " + path);
-            return super.getResources(path);
-        }
-
-        @Override
-        protected WebResource[] getResourcesInternal(String path, boolean 
useClassLoaderResources) {
-            log.debug("MyDirContext#getResourcesInternal: " + path);
-            return super.getResourcesInternal(path, useClassLoaderResources);
-        }
-
-
-    }
-
     @Override
     protected void enhanceContext( final Context context )
         throws MojoExecutionException
@@ -387,8 +319,7 @@ public class RunMojo
             final List<String> classLoaderEntries = 
classLoaderEntriesCalculatorResult.getClassPathEntries();
             final List<File> tmpDirectories = 
classLoaderEntriesCalculatorResult.getTmpDirectories();
 
-            context.setResources(new MyDirContext(new 
File(project.getBuild().getOutputDirectory()).getAbsolutePath(),
-                    getPath(), getLog()));
+            context.setResources(new StandardRoot(context));
 
             /* Add jars */
             final List<String> jarPaths = extractJars( classLoaderEntries );


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

Reply via email to