[jboss-cvs] JBossAS SVN: r72284 - in projects: maven and 11 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 16 10:10:52 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-04-16 10:10:52 -0400 (Wed, 16 Apr 2008)
New Revision: 72284

Added:
   projects/maven/
   projects/maven/plugins/
   projects/maven/plugins/deployer/
   projects/maven/plugins/deployer/trunk/
   projects/maven/plugins/deployer/trunk/.classpath
   projects/maven/plugins/deployer/trunk/.project
   projects/maven/plugins/deployer/trunk/pom.xml
   projects/maven/plugins/deployer/trunk/src/
   projects/maven/plugins/deployer/trunk/src/main/
   projects/maven/plugins/deployer/trunk/src/main/java/
   projects/maven/plugins/deployer/trunk/src/main/java/org/
   projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/
   projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/
   projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/
   projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/
   projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/DeployerMojo.java
   projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/Deployment.java
Log:
Initial cut of the deployer plogin

Added: projects/maven/plugins/deployer/trunk/.classpath
===================================================================
--- projects/maven/plugins/deployer/trunk/.classpath	                        (rev 0)
+++ projects/maven/plugins/deployer/trunk/.classpath	2008-04-16 14:10:52 UTC (rev 72284)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.jar" sourcepath="/M2_REPO/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9-sources.jar"/>
+	<classpathentry kind="output" path="target/eclipse"/>
+</classpath>

Added: projects/maven/plugins/deployer/trunk/.project
===================================================================
--- projects/maven/plugins/deployer/trunk/.project	                        (rev 0)
+++ projects/maven/plugins/deployer/trunk/.project	2008-04-16 14:10:52 UTC (rev 72284)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>maven-deployer-plugin</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: projects/maven/plugins/deployer/trunk/pom.xml
===================================================================
--- projects/maven/plugins/deployer/trunk/pom.xml	                        (rev 0)
+++ projects/maven/plugins/deployer/trunk/pom.xml	2008-04-16 14:10:52 UTC (rev 72284)
@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <name>Maven Deployer Plugin</name>
+  <groupId>org.jboss.maven.plugin</groupId>
+  <artifactId>maven-deployer-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <url>http://maven.apache.org</url>
+  
+  <version>1.0-SNAPSHOT</version>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0.9</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0.9</version>
+      <classifier>sources</classifier>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.jboss.maven.plugin</groupId>
+        <artifactId>maven-deployer-plugin</artifactId>
+        <version>${version}</version>
+        <configuration>
+          <jbossHome>/home/tdiesler/svn/jbossas/tags/JBoss_5_0_0_Beta4/build/output/jboss-5.0.0.Beta4</jbossHome>
+          <deployments>
+            <deployment>
+              <sourceDir></sourceDir>
+            </deployment>
+          </deployments>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+</project>


Property changes on: projects/maven/plugins/deployer/trunk/pom.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/DeployerMojo.java
===================================================================
--- projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/DeployerMojo.java	                        (rev 0)
+++ projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/DeployerMojo.java	2008-04-16 14:10:52 UTC (rev 72284)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.maven.plugin.deployer;
+
+// $Id$
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Goal which touches a timestamp file.
+ *
+ * @goal deploy-jboss
+ * @phase package
+ * 
+ * @author Thomas.Diesler at jboss.com
+ * @since 16-Apr-2008
+ */
+public class DeployerMojo extends AbstractMojo
+{
+   /** 
+    * @required
+    * @parameter 
+    */
+   private File jbossHome;
+   
+   /** 
+    * @required
+    * @parameter 
+    */
+   private List<Deployment> deployments;
+   
+   public void execute() throws MojoExecutionException
+   {
+      getPluginContext().put("artifactId", "maven-deployer-plugin");
+      
+      validateConfiguration();
+      
+      getLog().info("jbossHome: " + jbossHome);
+      for (Deployment dep : deployments)
+      {
+         dep.validateConfiguration(this);
+         processDeployment(dep);
+      }
+   }
+
+   private void processDeployment(Deployment dep)
+   {
+      getLog().info(" +- " + dep.getTargetDir());
+   }
+
+   private void validateConfiguration() throws MojoExecutionException
+   {
+      if (jbossHome.exists() == false)
+         throw new MojoExecutionException("jbossHome does not exist: " + jbossHome);
+   }
+}


Property changes on: projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/DeployerMojo.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/Deployment.java
===================================================================
--- projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/Deployment.java	                        (rev 0)
+++ projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/Deployment.java	2008-04-16 14:10:52 UTC (rev 72284)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.maven.plugin.deployer;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+// $Id$
+
+public class Deployment
+{
+   /** 
+    * @required
+    * @parameter 
+    */
+   private String targetDir;
+   /** 
+    * @parameter 
+    */
+   private String sourceDir;
+
+   public String getSourceDir()
+   {
+      return sourceDir;
+   }
+
+   public String getTargetDir()
+   {
+      return targetDir;
+   }
+
+   public void validateConfiguration(AbstractMojo mojo) throws MojoExecutionException
+   {
+      if (targetDir == null)
+      {
+         mojo.getLog().info("<deployments>");
+         mojo.getLog().info("  <deployment>");
+         mojo.getLog().info("    <targetDir>VALUE</targetDir>");
+         mojo.getLog().info("    ...");
+         mojo.getLog().info("  </deployment>");
+         mojo.getLog().info("</deployments>");
+
+         String artifactId = (String)mojo.getPluginContext().get("artifactId");
+         throw new MojoExecutionException("Inside the definition for plugin '" + artifactId + "' specify the following");
+      }
+   }
+}


Property changes on: projects/maven/plugins/deployer/trunk/src/main/java/org/jboss/maven/plugin/deployer/Deployment.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jboss-cvs-commits mailing list