tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1408507 - /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
Date Mon, 12 Nov 2012 23:30:26 GMT
Author: olamy
Date: Mon Nov 12 23:30:25 2012
New Revision: 1408507

URL: http://svn.apache.org/viewvc?rev=1408507&view=rev
Log:
we add artifact dependencies and projects from reactor if file (ie jar) as users can go to
install/package phase
so artifact.getFile is a file not a directory and not added when iterate on project.classPathElements

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=1408507&r1=1408506&r2=1408507&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
Mon Nov 12 23:30:25 2012
@@ -45,7 +45,7 @@ import java.util.Set;
  * @author Olivier Lamy
  * @since 2.0
  */
-@Component( role = ClassLoaderEntriesCalculator.class )
+@Component (role = ClassLoaderEntriesCalculator.class)
 public class DefaultClassLoaderEntriesCalculator
     implements ClassLoaderEntriesCalculator
 {
@@ -66,7 +66,7 @@ public class DefaultClassLoaderEntriesCa
         // add classes directories to loader
         try
         {
-            @SuppressWarnings( "unchecked" ) List<String> classPathElements = request.isUseTestClassPath()
+            @SuppressWarnings ("unchecked") List<String> classPathElements = request.isUseTestClassPath()
                 ? request.getMavenProject().getTestClasspathElements()
                 : request.getMavenProject().getCompileClasspathElements();
             if ( classPathElements != null )
@@ -113,7 +113,10 @@ public class DefaultClassLoaderEntriesCa
                     request.getLog().debug(
                         "add dependency to webapploader " + artifact.getGroupId() + ":" +
artifact.getArtifactId() + ":"
                             + artifact.getVersion() + ":" + artifact.getScope() );
-                    if ( !isInProjectReferences( artifact, request.getMavenProject() ) )
+                    // we add artifact dependencies and projects from reactor if file (ie
jar) as users can go to install/package phase
+                    // so artifact.getFile is a file not a directory and not added when iterate
on project.classPathElements
+                    if ( !isInProjectReferences( artifact, request.getMavenProject() ) ||
( artifact.getFile().exists()
+                        && artifact.getFile().isFile() ) )
                     {
                         String fileName = artifact.getFile().getName();
                         if ( !fileInClassLoaderEntries.contains( fileName ) )
@@ -126,6 +129,7 @@ public class DefaultClassLoaderEntriesCa
                     {
                         request.getLog().debug(
                             "skip adding artifact " + artifact.getArtifactId() + " as it's
in reactors" );
+
                     }
                 }
 
@@ -217,7 +221,7 @@ public class DefaultClassLoaderEntriesCa
         {
             return false;
         }
-        @SuppressWarnings( "unchecked" ) Collection<MavenProject> mavenProjects =
+        @SuppressWarnings ("unchecked") Collection<MavenProject> mavenProjects =
             project.getProjectReferences().values();
         for ( MavenProject mavenProject : mavenProjects )
         {



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


Mime
View raw message