[jboss-svn-commits] JBL Code SVN: r10033 - in labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main: resources/org/jboss/maven/plugins/deploy and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Mar 7 15:34:54 EST 2007


Author: pgier
Date: 2007-03-07 15:34:54 -0500 (Wed, 07 Mar 2007)
New Revision: 10033

Modified:
   labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
   labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml
Log:


Modified: labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
===================================================================
--- labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-03-07 20:33:05 UTC (rev 10032)
+++ labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-03-07 20:34:54 UTC (rev 10033)
@@ -10,14 +10,15 @@
 import java.io.InputStreamReader;
 import java.nio.channels.FileChannel;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.License;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectHelper;
 
 /**
  * Maven plugin for deploying to jboss repository.  By default
@@ -77,24 +78,6 @@
    protected Properties projectProperties;
 
    /**
-    * The maven project helper.
-    *
-    * @parameter expression="${component.org.apache.maven.project.MavenProjectHelper}"
-    * @required
-    * @readonly
-    */
-   private MavenProjectHelper projectHelper;
-
-   /**
-    * The source directories containing the sources to be compiled.
-    *
-    * @parameter expression="${project.compileSourceRoots}"
-    * @required
-    * @readonly
-    */
-   private List compileSourceRoots;
-
-   /**
     * The plugin dependencies.
     *
     * @parameter expression="${plugin.artifacts}"
@@ -104,23 +87,8 @@
    private List pluginArtifacts;
 
    /**
-    * @parameter expression="${project.pluginArtifacts}"
-    * @required
-    * @readonly
-    */
-   //private HashSet pluginArtifacts;
-   /**
     * The directory for compiled classes.
     *
-    * @parameter expression="${project.build.outputDirectory}"
-    * @required
-    * @readonly
-    */
-   private File targetClassesDirectory;
-
-   /**
-    * The directory for compiled classes.
-    *
     * @parameter expression="${project.build.directory}"
     * @required
     * @readonly
@@ -145,6 +113,18 @@
    private String jbossDeployRoot;
 
    /**
+    * This is the list of components that this project depends on.
+    * @parameter
+    */
+   private Map importsParam;
+   
+   /**
+    * This is the list of artifacts to be added to the classpath.
+    * @parameter
+    */
+   private List exportsParam;
+   
+   /**
     * Main execution path of the plugin.  Generates component-info.xml, and copies jar files to repository location.
     */
    public void execute() throws MojoExecutionException
@@ -247,8 +227,20 @@
       StringBuffer includes = new StringBuffer();
       includes.append("      <include input=\"" + artifactFileName + "\"/>");
       evaluateVariable(compInfoTemplate, "includes", includes.toString());
-      //TODO: List dependencies = project.getDependencies();
 
+      // Get list of imports
+      //TODO: Maybe this can be determined based on the dependencies, but for now we just have to set it 
+      //      in the plugin configuration 
+      //      List dependencies = project.getDependencies();
+      StringBuffer imports = new StringBuffer();
+      Set componentNames = importsParam.keySet();
+      for(Object component : componentNames) {
+         imports.append("    <import componentref=\"" + component + "\">\n");
+         imports.append("      <compatible version=\"" + importsParam.get(component) + "\"/>\n");
+         imports.append("    </import>\n");
+      }
+      evaluateVariable(compInfoTemplate, "imports", imports.toString());
+      
       // Write the component info file
       try
       {

Modified: labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml
===================================================================
--- labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml	2007-03-07 20:33:05 UTC (rev 10032)
+++ labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml	2007-03-07 20:34:54 UTC (rev 10033)
@@ -8,6 +8,7 @@
              > 
               
 ${artifacts}
+${imports}
     <export>
 ${includes}
     </export>




More information about the jboss-svn-commits mailing list