geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r686689 - /geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java
Date Mon, 18 Aug 2008 07:58:13 GMT
Author: djencks
Date: Mon Aug 18 00:58:13 2008
New Revision: 686689

URL: http://svn.apache.org/viewvc?rev=686689&view=rev
Log:
GERONIMO-4248 added and removed lists were switched

Modified:
    geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java

Modified: geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java?rev=686689&r1=686688&r2=686689&view=diff
==============================================================================
--- geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java
(original)
+++ geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/DependencyChangeMojo.java
Mon Aug 18 00:58:13 2008
@@ -89,30 +89,30 @@
                 FileReader in = new FileReader(dependencyFile);
                 try {
                     PluginArtifactType pluginArtifactType = PluginXmlUtil.loadPluginArtifactMetadata(in);
-                    PluginArtifactType added = new PluginArtifactType();
+                    PluginArtifactType removed = new PluginArtifactType();
                     for (DependencyType test: pluginArtifactType.getDependency()) {
                         Dependency testDependency = Dependency.newDependency(test);
                         if (!dependencies.remove(testDependency)) {
-                            added.getDependency().add(test);
+                            removed.getDependency().add(test);
                         }
                     }
-                    if (!dependencies.isEmpty() || !added.getDependency().isEmpty()) {
-                        File removedFile = new File(dependencyFile.getParentFile(), "dependencies.removed.xml");
-                        PluginArtifactType removed = toPluginArtifactType(dependencies);
-                        writeDependencies(removed,  removedFile);
+                    if (!dependencies.isEmpty() || !removed.getDependency().isEmpty()) {
                         File addedFile = new File(dependencyFile.getParentFile(), "dependencies.added.xml");
+                        PluginArtifactType added = toPluginArtifactType(dependencies);
                         writeDependencies(added,  addedFile);
+                        File removedFile = new File(dependencyFile.getParentFile(), "dependencies.removed.xml");
+                        writeDependencies(removed,  removedFile);
                         if (failOnChange) {
                             StringWriter out = new StringWriter();
                             out.write("Dependencies have changed:\n");
-                            if (!removed.getDependency().isEmpty()) {
-                                out.write("removed:\n");
-                                PluginXmlUtil.writePluginArtifact(removed, out);
-                            }
                             if (!added.getDependency().isEmpty()) {
                                 out.write("added:\n");
                                 PluginXmlUtil.writePluginArtifact(added, out);
                             }
+                            if (!removed.getDependency().isEmpty()) {
+                                out.write("removed:\n");
+                                PluginXmlUtil.writePluginArtifact(removed, out);
+                            }
                             throw new MojoFailureException(out.toString());
                         }
                     }



Mime
View raw message