tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1196179 - in /tomcat/maven-plugin/trunk: tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
Date Tue, 01 Nov 2011 18:10:02 GMT
Author: olamy
Date: Tue Nov  1 18:10:01 2011
New Revision: 1196179

URL: http://svn.apache.org/viewvc?rev=1196179&view=rev
Log:
[MTOMCAT-103] Executable War fails to run with a NullPointerException
do not record jar entry starting with / remove it.

Modified:
    tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
    tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java

Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java?rev=1196179&r1=1196178&r2=1196179&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java
Tue Nov  1 18:10:01 2011
@@ -282,10 +282,11 @@ public abstract class AbstractExecWarMoj
 
             if ( "war".equals( project.getPackaging() ) )
             {
-                os.putArchiveEntry( new JarArchiveEntry( path + ".war" ) );
+
+                os.putArchiveEntry( new JarArchiveEntry( StringUtils.removeStart( path, "/"
) + ".war" ) );
                 IOUtils.copy( new FileInputStream( projectArtifact.getFile() ), os );
                 os.closeArchiveEntry();
-                properties.put( Tomcat7Runner.WARS_KEY, path + ".war|" + path );
+                properties.put( Tomcat7Runner.WARS_KEY, StringUtils.removeStart( path, "/"
) + ".war|" + path );
             }
 
             if ( "pom".equals( project.getPackaging() ) && ( warRunDependencies !=
null
@@ -318,13 +319,11 @@ public abstract class AbstractExecWarMoj
                         if ( propertyWarValue != null )
                         {
                             properties.put( Tomcat7Runner.WARS_KEY,
-                                            propertyWarValue + ";" + warFileName + "|"
-                                                + warRunDependency.contextPath );
+                                            propertyWarValue + ";" + warFileName + "|" +
warRunDependency.contextPath );
                         }
                         else
                         {
-                            properties.put( Tomcat7Runner.WARS_KEY,
-                                            warFileName + "|" + warRunDependency.contextPath
);
+                            properties.put( Tomcat7Runner.WARS_KEY, warFileName + "|" + warRunDependency.contextPath
);
                         }
                     }
                 }

Modified: tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java?rev=1196179&r1=1196178&r2=1196179&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
Tue Nov  1 18:10:01 2011
@@ -343,7 +343,12 @@ public class Tomcat7Runner
             inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(
"conf/" + fileName );
             if ( inputStream != null )
             {
-                expand( inputStream, new File( extractDirectory, "conf/" + fileName ) );
+                File confDirectory = new File( extractDirectory, "conf" );
+                if ( !confDirectory.exists() )
+                {
+                    confDirectory.mkdirs();
+                }
+                expand( inputStream, new File( confDirectory, fileName ) );
             }
         }
         finally



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message