directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r601339 - in /directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins: AbstractStudioMojo.java StudioCleanMojo.java StudioEclipseMojo.java
Date Wed, 05 Dec 2007 14:01:39 GMT
Author: felixk
Date: Wed Dec  5 06:01:38 2007
New Revision: 601339

URL: http://svn.apache.org/viewvc?rev=601339&view=rev
Log:
- Skip writable
- Fix libraryPath

Modified:
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
    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/AbstractStudioMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java?rev=601339&r1=601338&r2=601339&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
(original)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
Wed Dec  5 06:01:38 2007
@@ -84,11 +84,19 @@
      * 
      * @parameter expression="true"
      * @required
-     * @readonly
      */
     protected boolean skip;
 
     /**
+     * Relativ Path to copy libraries to. Defaults to lib
+     * 
+     * @parameter expression="lib"
+     * @required
+     * @readonly
+     */
+    protected String libraryPath;
+
+    /**
      * Artifact collector, needed to resolve dependencies.
      * 
      * @component role="org.apache.maven.artifact.resolver.ArtifactCollector"
@@ -449,5 +457,12 @@
      */
     public void setArtifactMetadataSource(ArtifactMetadataSource theArtifactMetadataSource)
{
         this.artifactMetadataSource = theArtifactMetadataSource;
+    }
+
+    /**
+     * @param libraryPath the libraryPath to set
+     */
+    public void setLibraryPath(String pLibraryPath) {
+            this.libraryPath = pLibraryPath;
     }
 }

Modified: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java?rev=601339&r1=601338&r2=601339&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
(original)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
Wed Dec  5 06:01:38 2007
@@ -37,6 +37,8 @@
  */
 public class StudioCleanMojo extends AbstractStudioMojo {
 
+    private final String MAVEN_ECLIPSE_XML = "maven-eclipse.xml";
+    private final String EXTERNAL_TOOL_BUILDERS_DIR = ".externalToolBuilders";
     /**
      * POM
      * 
@@ -48,13 +50,13 @@
 
     public void execute() throws MojoExecutionException {
         try {
-            File file = new File(project.getBasedir(), "maven-eclipse.xml");
+            File file = new File(project.getBasedir(), MAVEN_ECLIPSE_XML);
             getLog().info("Deleting " + file);
             file.delete();
-            file = new File(project.getBasedir(), ".externalToolBuilder");
+            file = new File(project.getBasedir(), EXTERNAL_TOOL_BUILDERS_DIR);
             getLog().info("Deleting " + file);
             deleteDirectory(file);
-            file = new File(project.getBasedir(), "lib");
+            file = new File(project.getBasedir(), libraryPath);
             getLog().info("Deleting " + file);
             deleteDirectory(file);
         } catch (Exception e) {

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=601339&r1=601338&r2=601339&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
Wed Dec  5 06:01:38 2007
@@ -51,7 +51,7 @@
  * 
  * @goal eclipse
  * @execute phase="generate-resources"
- * @description Copy artifacts nonscoped "provided" to ${basedir}/lib, 
+ * @description Copy artifacts nonscoped "provided" to libraryPath,
  *              Add artifacts nonscoped "provided" to Bundle-ClassPath and MANIFEST.MF, 
  *              Adapt ${basedir}/.classpath for artifacts nonscoped "provided"
  * @requiresProject
@@ -81,13 +81,6 @@
      */
     public final static String ENTRY_BUNDLE_CLASSPATH = "Bundle-ClassPath:";
 
-    /**
-     * classpathPrefix
-     * 
-     * @parameter expression="."
-     */
-    private String classpathPrefix;
-
     public void execute() throws MojoExecutionException {
         if (!skip) {
             try {
@@ -134,7 +127,7 @@
     private void copyArtifacts(final List<Artifact> list) throws IOException {
         // Only proceed when we have artifacts to process
         if (!list.isEmpty()) {
-            final File copyDir = new File(project.getBasedir(), classpathPrefix);
+            final File copyDir = new File(project.getBasedir(), libraryPath);
 
             if (!copyDir.exists())
                 copyDir.mkdirs();
@@ -161,7 +154,7 @@
         // Build Bundle-ClassPath entry
         final StringBuilder bundleClasspath = new StringBuilder(" .");
         for (Artifact artifact : list) {
-            bundleClasspath.append(",").append(NEWLINE).append(" ").append(classpathPrefix).append(File.separator)
+            bundleClasspath.append(",").append(NEWLINE).append(" ").append(libraryPath).append(File.separator)
                     .append(artifact.getFile().getName());
         }
 
@@ -213,7 +206,7 @@
                 if (pathValue.indexOf(artifact.getFile().getName()) > -1) {
                     cpEntry.setAttribute("exported", "true");
                     cpEntry.setAttribute("kind", "lib");
-                    cpEntry.setAttribute("path", classpathPrefix + File.separator + artifact.getFile().getName());
+                    cpEntry.setAttribute("path", libraryPath + File.separator + artifact.getFile().getName());
                 }
             }
         }
@@ -228,10 +221,4 @@
         w.close();
     }
 
-    /**
-     * @param classpathPrefix
-     */
-    public void setClasspathPrefix(String classpathPrefix) {
-        this.classpathPrefix = classpathPrefix;
-    }
 }



Mime
View raw message