You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/07/18 22:27:30 UTC

svn commit: r423233 - /cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/AbstractDeployMojo.java

Author: cziegeler
Date: Tue Jul 18 13:27:29 2006
New Revision: 423233

URL: http://svn.apache.org/viewvc?rev=423233&view=rev
Log:
Only deploy of correct scope

Modified:
    cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/AbstractDeployMojo.java

Modified: cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/AbstractDeployMojo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/AbstractDeployMojo.java?rev=423233&r1=423232&r2=423233&view=diff
==============================================================================
--- cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/AbstractDeployMojo.java (original)
+++ cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/AbstractDeployMojo.java Tue Jul 18 13:27:29 2006
@@ -231,33 +231,46 @@
         Map files = new HashMap();
         for(Iterator it = this.getProject().getArtifacts().iterator(); it.hasNext(); ) {
             Artifact artifact = (Artifact) it.next();
-            String id = artifact.getArtifactId();
-            if (files.containsKey(id)) {
-                // Now search for all artifacts and print their dependency trail
-                StringBuffer msg = new StringBuffer("There are at least two artifacts with the ID '");
-                msg.append(id);
-                msg.append("':");
-                msg.append(SystemUtils.LINE_SEPARATOR);
-                for(Iterator ai = this.getProject().getArtifacts().iterator(); ai.hasNext(); ) {
-                    final Artifact current = (Artifact) ai.next();
-                    if ( current.getArtifactId().equals(id) ) {
-                        msg.append(artifact);
-                        msg.append(SystemUtils.LINE_SEPARATOR);
-                        final List l = current.getDependencyTrail();
+            if ( artifact.getScope() == Artifact.SCOPE_RUNTIME ) {
+                String id = artifact.getArtifactId();
+                if (files.containsKey(id)) {
+                    // Now search for all artifacts and print their dependency trail
+                    StringBuffer msg = new StringBuffer("There are at least two artifacts with the ID '");
+                    msg.append(id);
+                    msg.append("':");
+                    msg.append(SystemUtils.LINE_SEPARATOR);
+                    for(Iterator ai = this.getProject().getArtifacts().iterator(); ai.hasNext(); ) {
+                        final Artifact current = (Artifact) ai.next();
+                        if ( current.getArtifactId().equals(id) ) {
+                            msg.append(artifact);
+                            msg.append(SystemUtils.LINE_SEPARATOR);
+                            final List l = current.getDependencyTrail();
+                            final Iterator i = l.iterator();
+                            while ( i.hasNext() ) {
+                                msg.append("    ");
+                                msg.append(i.next().toString());
+                                msg.append(SystemUtils.LINE_SEPARATOR);
+                            }
+                        }
+                    }
+                    throw new MojoExecutionException(msg.toString());
+                }
+                if (containsArtifact(excludedBlocks, artifact.getArtifactId(), artifact.getGroupId())) {
+                    this.getLog().debug("Skipping " + artifact);
+                } else {
+                    files.put(id, artifact.getFile());
+                    if ( this.getLog().isDebugEnabled() ) {
+                        StringBuffer msg = new StringBuffer("Deploying " + artifact);
+                        final List l = artifact.getDependencyTrail();
                         final Iterator i = l.iterator();
                         while ( i.hasNext() ) {
                             msg.append("    ");
                             msg.append(i.next().toString());
                             msg.append(SystemUtils.LINE_SEPARATOR);
                         }
+                        this.getLog().debug(msg.toString());
                     }
                 }
-                throw new MojoExecutionException(msg.toString());
-            }
-            if(containsArtifact(excludedBlocks, artifact.getArtifactId(), artifact.getGroupId())) {
-                this.getLog().debug("Skipping " + artifact.getArtifactId() + ":" + artifact.getGroupId());
-            } else {
-                files.put(id, artifact.getFile());
             }
         }
         return files;