[jboss-svn-commits] JBL Code SVN: r17327 - in labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin: src/it and 8 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Dec 19 16:22:10 EST 2007


Author: pgier
Date: 2007-12-19 16:22:09 -0500 (Wed, 19 Dec 2007)
New Revision: 17327

Added:
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/pom.xml
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/java/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/java/foo/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/java/foo/project003/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/java/foo/project003/App.java
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/default-configuration.properties
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/excluded-file.txt
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/verify.bsh
Modified:
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/pom.xml
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
Log:
[JBBUILD-440] Adding parameter to allow skipping deployment.

Modified: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/pom.xml
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/pom.xml	2007-12-19 19:32:30 UTC (rev 17326)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/pom.xml	2007-12-19 21:22:09 UTC (rev 17327)
@@ -39,17 +39,6 @@
     </plugins>
   </build>
   
-  <repositories>
-    <repository>
-      <id>repository.jboss.org</id>
-      <name>JBoss Repository</name>
-      <url>http://repository.jboss.org/maven2/</url>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-  
   <reporting>
     <plugins>
       <plugin>


Property changes on: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip
___________________________________________________________________
Name: svn:ignore
   + target


Added: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/pom.xml
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/pom.xml	                        (rev 0)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/pom.xml	2007-12-19 21:22:09 UTC (rev 17327)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<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>
+  <groupId>org.jboss.maven.plugins</groupId>
+  <artifactId>maven-jboss-deploy-plugin-test</artifactId>
+  <version>99.0</version>
+  <name>Maven</name>
+  <packaging>jar</packaging>
+  <description>Change the default artifactId</description>
+  <dependencies>
+    <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-jar-plugin</artifactId>
+        <version>2.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.jboss.maven.plugins</groupId>
+        <artifactId>maven-jboss-deploy-plugin</artifactId>
+        <version>@pom.version@</version>
+        <executions>
+          <execution>
+            <id>test-execution</id>
+            <phase>package</phase>
+            <goals>
+              <goal>jboss-deploy</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <jbossDeployRoot>${project.build.directory}/jboss-ant-repo</jbossDeployRoot>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <properties>
+    <maven.jboss-deploy.skip>true</maven.jboss-deploy.skip>
+  </properties>
+</project>

Added: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/java/foo/project003/App.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/java/foo/project003/App.java	                        (rev 0)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/java/foo/project003/App.java	2007-12-19 21:22:09 UTC (rev 17327)
@@ -0,0 +1,32 @@
+package foo.project003;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/default-configuration.properties
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/default-configuration.properties	                        (rev 0)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/default-configuration.properties	2007-12-19 21:22:09 UTC (rev 17327)
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.

Added: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/excluded-file.txt
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/excluded-file.txt	                        (rev 0)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/src/main/resources/excluded-file.txt	2007-12-19 21:22:09 UTC (rev 17327)
@@ -0,0 +1 @@
+This file is excluded by the custom configuration, so shouldn't end up in the end product
\ No newline at end of file

Added: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/verify.bsh
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/verify.bsh	                        (rev 0)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/verify.bsh	2007-12-19 21:22:09 UTC (rev 17327)
@@ -0,0 +1,53 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File repo = new File( basedir, "target/jboss-ant-repo" );
+    
+    File componentInfo = new File ( repo, "org/jboss/maven/plugins/maven-jboss-deploy-plugin-test/99.0/component-info.xml" );
+    if ( componentInfo.exists() )
+    {
+        System.err.println( "component-info.xml file should not have been deployed." );
+        return false;
+    } 
+    
+    File outputJar = new File ( repo, "org/jboss/maven/plugins/maven-jboss-deploy-plugin-test/99.0/lib/maven-jboss-deploy-plugin-test-99.0.jar" );
+    if ( outputJar.exists() )
+    {
+        System.err.println( "Output jar should not have been deployed. \n" + outputJar);
+        return false;
+    } 
+    
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;


Property changes on: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/it/skip/verify.bsh
___________________________________________________________________
Name: svn:executable
   + *

Modified: labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-12-19 19:32:30 UTC (rev 17326)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-deploy-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-12-19 21:22:09 UTC (rev 17327)
@@ -131,6 +131,14 @@
     * @parameter
     */
    private Set<String> exports;
+   
+   /**
+    * This parameter provides an option to skip execution of the plugin.  This parameter
+    * can be set from the command line using the property maven.jboss-deploy.skip.
+    * @parameter expression="${maven.jboss-deploy.skip}"
+    * 
+    */
+   private boolean skip;
 
    /**
     * Main execution path of the plugin.  Generates component-info.xml, and copies jar files to repository location.
@@ -138,7 +146,14 @@
    public void execute() throws MojoExecutionException
    {
       this.getLog().debug("Executing JBoss deploy plugin");
-
+      
+      // Check if we should skip execution of this plugin
+      if ( skip )
+      {
+         this.getLog().info("Skipping execution of jboss-deploy plugin");
+         return;
+      }
+      
       // Check that there is at least one artifact to deploy
       if ((project.getArtifact() == null || project.getArtifact().getFile() == null)
             && project.getAttachedArtifacts().size() == 0)




More information about the jboss-svn-commits mailing list