directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r602700 - /directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
Date Sun, 09 Dec 2007 17:36:48 GMT
Author: felixk
Date: Sun Dec  9 09:36:46 2007
New Revision: 602700

URL: http://svn.apache.org/viewvc?rev=602700&view=rev
Log:
Do not process artifacts with scope test (and provided which are already not contained in
list)

Modified:
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java

Modified: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java?rev=602700&r1=602699&r2=602700&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
(original)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
Sun Dec  9 09:36:46 2007
@@ -139,11 +139,15 @@
                 copyDir.mkdirs();
 
             for (Artifact artifact : list) {
-                final File destFile = new File(copyDir, artifact.getFile()
-                        .getName());
-                FileUtils.copyFile(artifact.getFile(), destFile);
-                getLog().info(
-                        "Copying " + artifact.getFile() + " to " + destFile);
+                if (!artifact.getScope().equalsIgnoreCase("test")) {
+                    final File destFile = new File(copyDir, artifact.getFile()
+                            .getName());
+                    FileUtils.copyFile(artifact.getFile(), destFile);
+                    getLog()
+                            .info(
+                                    "Copying " + artifact.getFile() + " to "
+                                            + destFile);
+                }
             }
         }
     }
@@ -164,9 +168,11 @@
         // Build Bundle-ClassPath entry
         final StringBuilder bundleClasspath = new StringBuilder(" .");
         for (Artifact artifact : list) {
-            bundleClasspath.append(",").append(NEWLINE).append(" ").append(
-                    libraryPath).append(File.separator).append(
-                    artifact.getFile().getName());
+            if (!artifact.getScope().equalsIgnoreCase("test")) {
+                bundleClasspath.append(",").append(NEWLINE).append(" ").append(
+                        libraryPath).append(File.separator).append(
+                        artifact.getFile().getName());
+            }
         }
 
         boolean inBundleClasspathEntry = false;
@@ -225,13 +231,22 @@
             cnt++;
         }
 
+        Xpp3Dom entry;
         for (Artifact artifact : list) {
-            final Xpp3Dom entry = new Xpp3Dom("classpathentry");
-            entry.setAttribute("exported", "true");
-            entry.setAttribute("kind", "lib");
-            entry.setAttribute("path", (new StringBuilder())
-                    .append(libraryPath).append(File.separator).append(
-                            artifact.getFile().getName()).toString());
+            if (artifact.getScope().equalsIgnoreCase("test")) {
+                entry = new Xpp3Dom("classpathentry");
+                entry.setAttribute("kind", "lib");
+                entry.setAttribute("path", (new StringBuilder()).append(
+                        libraryPath).append(File.separator).append(
+                        artifact.getFile().getName()).toString());
+            } else {
+                entry = new Xpp3Dom("classpathentry");
+                entry.setAttribute("exported", "true");
+                entry.setAttribute("kind", "lib");
+                entry.setAttribute("path", (new StringBuilder()).append(
+                        libraryPath).append(File.separator).append(
+                        artifact.getFile().getName()).toString());
+            }
             dom.addChild(entry);
         }
 



Mime
View raw message