Author: davsclaus
Date: Wed Sep 17 23:43:26 2008
New Revision: 696574

URL: http://svn.apache.org/viewvc?rev=696574&view=rev
Log:
CAMEL-914: camel:run should NOT add test-classes to classpath. Added INFO 
logging of the classpath resolved just as jetty:run does

Modified:
    
activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java

Modified: 
activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java?rev=696574&r1=696573&r2=696574&view=diff
==============================================================================
--- 
activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
 (original)
+++ 
activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
 Wed Sep 17 23:43:26 2008
@@ -409,9 +409,7 @@
         // but it's too late since the termination condition (only daemon
         // threads) has been triggered.
         if (keepAlive) {
-            getLog()
-                .warn(
-                      "Warning: keepAlive is now deprecated and obsolete. Do 
you need it? Please comment on MEXEC-6.");
+            getLog().warn("Warning: keepAlive is now deprecated and obsolete. 
Do you need it? Please comment on MEXEC-6.");
             waitFor(0);
         }
 
@@ -597,6 +595,8 @@
         List classpathURLs = new ArrayList();
         this.addRelevantPluginDependenciesToClasspath(classpathURLs);
         this.addRelevantProjectDependenciesToClasspath(classpathURLs);
+
+        getLog().info("Classpath = " + classpathURLs);
         return new URLClassLoader((URL[])classpathURLs.toArray(new 
URL[classpathURLs.size()]));
     }
 
@@ -646,7 +646,7 @@
 
                 // system scope dependencies are not returned by maven 2.0. See
                 // MEXEC-17
-                dependencies.addAll(getSystemScopeDependencies());
+                dependencies.addAll(getAllNonTestScopedDependencies());
 
                 Iterator iter = dependencies.iterator();
                 while (iter.hasNext()) {
@@ -668,17 +668,18 @@
 
     }
 
-    private Collection getSystemScopeDependencies() throws 
MojoExecutionException {
-        List systemScopeArtifacts = new ArrayList();
+    private Collection getAllNonTestScopedDependencies() throws 
MojoExecutionException {
+        List answer = new ArrayList();
 
         for (Iterator artifacts = getAllDependencies().iterator(); 
artifacts.hasNext();) {
             Artifact artifact = (Artifact)artifacts.next();
 
-            // if (artifact.getScope().equals(Artifact.SCOPE_SYSTEM)) {
-            systemScopeArtifacts.add(artifact);
-            // }
+            // do not add test artifacts
+            if (!artifact.getScope().equals(Artifact.SCOPE_TEST)) {
+                answer.add(artifact);
+            }
         }
-        return systemScopeArtifacts;
+        return answer;
     }
 
     // generic method to retrieve all the transitive dependencies
@@ -719,7 +720,7 @@
             List exclusions = new ArrayList();
             for (Iterator j = dependency.getExclusions().iterator(); 
j.hasNext();) {
                 Exclusion e = (Exclusion)j.next();
-                exclusions.add(e.getGroupId() + ":" + e.getArtifactId()); 
//$NON-NLS-1$
+                exclusions.add(e.getGroupId() + ":" + e.getArtifactId());
             }
 
             ArtifactFilter newFilter = new ExcludesArtifactFilter(exclusions);
@@ -773,8 +774,7 @@
     /**
      * Examine the plugin dependencies to find the executable artifact.
      *
-     * @return an artifact which refers to the actual executable tool (not a
-     *         POM)
+     * @return an artifact which refers to the actual executable tool (not a 
POM)
      * @throws MojoExecutionException
      */
     private Artifact findExecutableArtifact() throws MojoExecutionException {
@@ -848,8 +848,7 @@
             try {
                 lock.wait(millis);
             } catch (InterruptedException e) {
-                Thread.currentThread().interrupt(); // good practice if don't
-                // throw
+                Thread.currentThread().interrupt(); // good practice if don't 
throw
                 getLog().warn("Spuriously interrupted while waiting for " + 
millis + "ms", e);
             }
         }


Reply via email to