Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: jamezp/jboss-as-maven-plugin
base: 170eb191a5
...
head fork: jamezp/jboss-as-maven-plugin
compare: 3ff1eddd6c
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
4 src/main/java/org/jboss/as/plugin/deployment/Undeploy.java
@@ -30,10 +30,10 @@
* @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a>
* @goal undeploy
*/
-public final class Undeploy extends AbstractDeployment {
+public class Undeploy extends AbstractDeployment {
/**
- * @parameter default-value="false" expression="${undeploy.ignoreMissingDeployment}"
+ * @parameter default-value="true" expression="${undeploy.ignoreMissingDeployment}"
*/
private boolean ignoreMissingDeployment;
View
106 src/main/java/org/jboss/as/plugin/deployment/UndeployArtifact.java
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.as.plugin.deployment;
+
+import java.io.File;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Undeploys (removes) an arbitrary artifact to the JBoss application server
+ *
+ * @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a>
+ * @goal undeploy-artifact
+ */
+public final class UndeployArtifact extends Undeploy {
+
+ /**
+ * The artifact to deploys groupId
+ *
+ * @parameter
+ */
+ private String groupId;
+
+
+ /**
+ * The artifact to deploys artifactId
+ *
+ * @parameter
+ */
+ private String artifactId;
+
+ /**
+ * @parameter default-value="${project}"
+ * @readonly
+ * @required
+ */
+ private MavenProject project;
+
+ /**
+ * The resolved dependency file
+ */
+ private File file;
+
+
+ @Override
+ public void validate() throws MojoFailureException {
+ if (artifactId == null) {
+ throw new MojoFailureException("undeploy-artifact must specify the artifactId");
+ }
+ if (groupId == null) {
+ throw new MojoFailureException("undeploy-artifact must specify the groupId");
+ }
+ @SuppressWarnings("unchecked")
+ final Set<Artifact> dependencies = project.getArtifacts();
+ Artifact artifact = null;
+ for (final Artifact a : dependencies) {
+ if (a.getArtifactId().equals(artifactId) &&
+ a.getGroupId().equals(groupId)) {
+ artifact = a;
+ break;
+ }
+ }
+ if (artifact == null) {
+ throw new MojoFailureException("Could not resolve artifact to deploy " + groupId + ":" + artifactId);
+ }
+ file = artifact.getFile();
+ }
+
+ @Override
+ public File file() {
+ return file;
+ }
+
+ @Override
+ public String goal() {
+ return "undeploy-artifact";
+ }
+
+ @Override
+ protected boolean checkPackaging() {
+ return false;
+ }
+}
View
1  src/site/apt/examples/add-resource-example.apt.vm
@@ -104,7 +104,6 @@ Adding Resources Examples
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<jndi-name>java:jboss/datasources/postgresDS</jndi-name>
<enabled>true</enabled>
- <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<pool-name>myPool</pool-name>
<driver-name>postgresql.jar</driver-name>
</properties>
View
40 src/site/apt/examples/complex-example.apt.vm
@@ -40,16 +40,6 @@ Complex Deployment and Resource Examples
</configuration>
</execution>
- <!-- Deploy the application on package -->
- <execution>
- <id>deploy</id>
- <phase>install</phase>
- <goals>
- <goal>deploy</goal>
- </goals>
- </configuration>
- </execution>
-
<!-- Deploy the JDBC library -->
<execution>
<id>deploy-driver</id>
@@ -104,7 +94,6 @@ Complex Deployment and Resource Examples
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<jndi-name>java:jboss/datasources/postgresDS</jndi-name>
<enabled>true</enabled>
- <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<pool-name>myPool</pool-name>
<driver-name>postgresql.jar</driver-name>
</properties>
@@ -150,6 +139,15 @@ Complex Deployment and Resource Examples
<goal>add-resource</goal>
</goals>
</execution>
+
+ <!-- Deploy the application on install -->
+ <execution>
+ <id>deploy</id>
+ <phase>install</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
</executions>
</plugin>
...
@@ -204,16 +202,6 @@ Complex Deployment and Resource Examples
</configuration>
</execution>
- <!-- Deploy the application on package -->
- <execution>
- <id>deploy</id>
- <phase>install</phase>
- <goals>
- <goal>deploy</goal>
- </goals>
- </configuration>
- </execution>
-
<!-- Deploy the JDBC library -->
<execution>
<id>deploy-driver</id>
@@ -268,7 +256,6 @@ Complex Deployment and Resource Examples
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<jndi-name>java:jboss/datasources/postgresDS</jndi-name>
<enabled>true</enabled>
- <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<pool-name>myPool</pool-name>
<driver-name>postgresql.jar</driver-name>
</properties>
@@ -314,6 +301,15 @@ Complex Deployment and Resource Examples
<goal>add-resource</goal>
</goals>
</execution>
+
+ <!-- Deploy the application on install -->
+ <execution>
+ <id>deploy</id>
+ <phase>install</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
</executions>
</plugin>
...

No commit comments for this range

Something went wrong with that request. Please try again.