You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2005/07/30 05:24:00 UTC
svn commit: r226468 - in
/portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven:
AbstractInstallationMojo.java InstallMojo.java ReinstallMojo.java
UninstallMojo.java
Author: ddewolf
Date: Fri Jul 29 20:23:55 2005
New Revision: 226468
URL: http://svn.apache.org/viewcvs?rev=226468&view=rev
Log:
Adding reinstall mojo.
Added:
portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java
Modified:
portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractInstallationMojo.java
portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java
portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java
Modified: portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractInstallationMojo.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractInstallationMojo.java?rev=226468&r1=226467&r2=226468&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractInstallationMojo.java (original)
+++ portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractInstallationMojo.java Fri Jul 29 20:23:55 2005
@@ -31,6 +31,21 @@
*/
public abstract class AbstractInstallationMojo extends AbstractMojo {
+ protected AbstractInstallationMojo() {
+
+ }
+
+ protected AbstractInstallationMojo(MavenProject project,
+ File installationDirectory,
+ File basedir,
+ String host, String engine) {
+ this.installationDirectory = installationDirectory;
+ this.host = host;
+ this.engine = engine;
+ this.project = project;
+ this.basedir = basedir;
+ }
+
/**
* @parameter expression="${pluto.installation.dir}"
* @required
Modified: portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java?rev=226468&r1=226467&r2=226468&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java (original)
+++ portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java Fri Jul 29 20:23:55 2005
@@ -17,6 +17,7 @@
package org.apache.pluto.maven;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
@@ -30,6 +31,17 @@
* @requiresDependencyResolution runtime
*/
public class InstallMojo extends AbstractInstallationMojo {
+
+ public InstallMojo() {
+
+ }
+
+ public InstallMojo(MavenProject project,
+ File installationDirectory,
+ File basedir,
+ String host, String engine) {
+ super(project, installationDirectory, basedir, host, engine);
+ }
protected void doExecute() throws Exception {
getLog().info("Installing Pluto to: "+installationDirectory.getAbsolutePath());
Added: portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java?rev=226468&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java (added)
+++ portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java Fri Jul 29 20:23:55 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.pluto.maven;
+
+
+
+/**
+ * @goal reinstall
+ * @requiresDependencyResolution runtime
+ */
+public class ReinstallMojo extends AbstractInstallationMojo {
+
+ public ReinstallMojo() {
+
+ }
+
+ protected void doExecute() throws Exception {
+ getLog().info("Reinstalling Pluto to: "+installationDirectory.getAbsolutePath());
+
+ UninstallMojo uninstaller =
+ new UninstallMojo(project, installationDirectory, basedir, host, engine);
+
+ uninstaller.doExecute();
+
+ InstallMojo installer =
+ new InstallMojo(project, installationDirectory, basedir, host, engine);
+
+ installer.doExecute();
+ }
+}
Modified: portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java?rev=226468&r1=226467&r2=226468&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java (original)
+++ portals/pluto/branches/pluto-1.1/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java Fri Jul 29 20:23:55 2005
@@ -18,6 +18,7 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
import java.io.File;
import java.util.Iterator;
@@ -30,6 +31,13 @@
*/
public class UninstallMojo extends AbstractInstallationMojo {
+ public UninstallMojo(MavenProject project,
+ File installationDirectory,
+ File basedir,
+ String host, String engine) {
+ super(project, installationDirectory, basedir, host, engine);
+ }
+
protected void doExecute() throws Exception {
getLog().info("Uninstalling Pluto from: "+installationDirectory.getAbsolutePath());
@@ -53,7 +61,7 @@
private void delete(File file) throws MojoExecutionException {
getLog().info("Deleting "+file.getAbsolutePath());
if(!file.delete()) {
- throw new MojoExecutionException("Could not delete file: "+file.getAbsolutePath());
+ getLog().warn("Could not delete the file: "+file.getAbsolutePath());
}
}