cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r423202 - /cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/java/org/apache/cocoon/maven/deployer/AbstractDeployMojo.java
Date Tue, 18 Jul 2006 19:15:15 GMT
Author: cziegeler
Date: Tue Jul 18 12:15:15 2006
New Revision: 423202

URL: http://svn.apache.org/viewvc?rev=423202&view=rev
Log:
Print out more information if a conflict arises

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=423202&r1=423201&r2=423202&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 12:15:15 2006
@@ -30,6 +30,7 @@
 import org.apache.cocoon.maven.deployer.monolithic.MonolithicCocoonDeployer;
 import org.apache.cocoon.maven.deployer.utils.WebApplicationRewriter;
 import org.apache.cocoon.maven.deployer.utils.XMLUtils;
+import org.apache.commons.lang.SystemUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -231,8 +232,27 @@
         for(Iterator it = this.getProject().getArtifacts().iterator(); it.hasNext(); ) {
             Artifact artifact = (Artifact) it.next();
             String id = artifact.getArtifactId();
-            if(files.containsKey(id)) {
-                throw new MojoExecutionException("There are at least two artifacts with the
ID '" + id + "'.");
+            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.getArtifactId() + ":" + artifact.getGroupId());



Mime
View raw message