You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ol...@apache.org on 2011/11/06 15:13:10 UTC

svn commit: r1198376 - /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java

Author: olamy
Date: Sun Nov  6 14:13:09 2011
New Revision: 1198376

URL: http://svn.apache.org/viewvc?rev=1198376&view=rev
Log:
[MTOMCAT-100] support war overlay to add war external dependencies in tomcat run
fix extraction of war overlay content files was extracted in .

Modified:
    tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java

Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java?rev=1198376&r1=1198375&r2=1198376&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java (original)
+++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java Sun Nov  6 14:13:09 2011
@@ -28,6 +28,7 @@ import org.codehaus.plexus.archiver.Arch
 import org.codehaus.plexus.archiver.UnArchiver;
 import org.codehaus.plexus.archiver.manager.ArchiverManager;
 import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
+import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.util.StringUtils;
@@ -130,6 +131,8 @@ public class DefaultClassLoaderEntriesCa
 
                     File tmpDir = new File( tmpExtractDatas, artifact.getArtifactId() );
 
+                    tmpDir.mkdirs();
+
                     tmpDirectories.add( tmpDir );
 
                     try
@@ -140,6 +143,8 @@ public class DefaultClassLoaderEntriesCa
                         unArchiver.setSourceFile( warFile );
                         unArchiver.setDestDirectory( tmpDir );
                         unArchiver.extract();
+
+
                         File libsDirectory = new File( tmpDir, "WEB-INF/lib" );
                         if ( libsDirectory.exists() )
                         {



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


Re: svn commit: r1198376 - /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/11/6  <ol...@apache.org>:
> Author: olamy
> Date: Sun Nov  6 14:13:09 2011
> New Revision: 1198376
>
> URL: http://svn.apache.org/viewvc?rev=1198376&view=rev
> Log:
> [MTOMCAT-100] support war overlay to add war external dependencies in tomcat run
> fix extraction of war overlay content files was extracted in .
>
> Modified:
>    tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
>

> --- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java (original)
> +++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java Sun Nov  6 14:13:09 2011
> @@ -28,6 +28,7 @@ import org.codehaus.plexus.archiver.Arch
>  import org.codehaus.plexus.archiver.UnArchiver;
>  import org.codehaus.plexus.archiver.manager.ArchiverManager;
>  import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
> +import org.codehaus.plexus.archiver.zip.ZipUnArchiver;

The above import is unused.

Best regards,
Konstantin Kolinko

>  import org.codehaus.plexus.component.annotations.Component;
>  import org.codehaus.plexus.component.annotations.Requirement;
>  import org.codehaus.plexus.util.StringUtils;
> @@ -130,6 +131,8 @@ public class DefaultClassLoaderEntriesCa
>
>                     File tmpDir = new File( tmpExtractDatas, artifact.getArtifactId() );
>
> +                    tmpDir.mkdirs();
> +
>                     tmpDirectories.add( tmpDir );
>
>                     try
> @@ -140,6 +143,8 @@ public class DefaultClassLoaderEntriesCa
>                         unArchiver.setSourceFile( warFile );
>                         unArchiver.setDestDirectory( tmpDir );
>                         unArchiver.extract();
> +
> +
>                         File libsDirectory = new File( tmpDir, "WEB-INF/lib" );
>                         if ( libsDirectory.exists() )
>                         {
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

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


Re: svn commit: r1198376 - /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java

Posted by Francis Galiegue <fg...@gmail.com>.
On Sun, Nov 6, 2011 at 19:31, Olivier Lamy <ol...@apache.org> wrote:
> 2011/11/6 Francis Galiegue <fg...@gmail.com>:
>> On Sun, Nov 6, 2011 at 15:13,  <ol...@apache.org> wrote:
>> [...]
>>>
>>> +                    tmpDir.mkdirs();
>>
>> Why isn't the return code checked? Are you sure at this point that you
>> can actually create the directories? What about ENOSPC?
> Sure why not.
> But as it's a subdirectory of the build output directory of the
> current maven project, we can presume all karma are correct to write
> those directories.

Sorry, not for ENOSPC, no...

-- 
Francis Galiegue, fgaliegue@gmail.com
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)

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


Re: svn commit: r1198376 - /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java

Posted by Olivier Lamy <ol...@apache.org>.
2011/11/6 Francis Galiegue <fg...@gmail.com>:
> On Sun, Nov 6, 2011 at 15:13,  <ol...@apache.org> wrote:
> [...]
>>
>> +                    tmpDir.mkdirs();
>
> Why isn't the return code checked? Are you sure at this point that you
> can actually create the directories? What about ENOSPC?
Sure why not.
But as it's a subdirectory of the build output directory of the
current maven project, we can presume all karma are correct to write
those directories.
>
> --
> Francis Galiegue, fgaliegue@gmail.com
> "It seems obvious [...] that at least some 'business intelligence'
> tools invest so much intelligence on the business side that they have
> nothing left for generating SQL queries" (Stéphane Faroult, in "The
> Art of SQL", ISBN 0-596-00894-5)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>



-- 
Olivier Lamy
Talend : http://talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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


Re: svn commit: r1198376 - /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java

Posted by Francis Galiegue <fg...@gmail.com>.
On Sun, Nov 6, 2011 at 15:13,  <ol...@apache.org> wrote:
[...]
>
> +                    tmpDir.mkdirs();

Why isn't the return code checked? Are you sure at this point that you
can actually create the directories? What about ENOSPC?

-- 
Francis Galiegue, fgaliegue@gmail.com
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)

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