ptahchiev
Wed, 02 Jul 2008 14:37:23 -0700
Author: ptahchiev Date: Wed Jul 2 14:36:31 2008 New Revision: 673511 URL: http://svn.apache.org/viewvc?rev=673511&view=rev Log: Changes made in order to make final modifications on the cactifyearmojo. Modified: jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyEarTask.java jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyWarTask.java jakarta/cactus/trunk/integration/maven2/pom.xml jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyEarMojo.java jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java Modified: jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyEarTask.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyEarTask.java?rev=673511&r1=673510&r2=673511&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyEarTask.java (original) +++ jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyEarTask.java Wed Jul 2 14:36:31 2008 @@ -53,7 +53,7 @@ /** * Cactus war configuration holder. */ - private CactusWar cactusWar; + private CactifyWarTask cactusWar; /** * The archive that contains the web-app that should be cactified. @@ -70,7 +70,7 @@ * * @param theCactusWar CactusWar to set */ - public void addConfiguredCactuswar(CactusWar theCactusWar) + public void addConfiguredCactuswar(CactifyWarTask theCactusWar) { cactusWar = theCactusWar; } @@ -217,7 +217,7 @@ throw new BuildException("Unable to add ejb-references", e); } } - + cactusWar.execute(); return tmpCactusWar; @@ -241,9 +241,9 @@ * * @return the CactusWar configuration */ - private CactusWar createCactusWarConfig() + private CactifyWarTask createCactusWarConfig() { - CactusWar cactusWarConfig = new CactusWar(); + CactifyWarTask cactusWarConfig = new CactifyWarTask(); Version version = new Version(); version.setValue("2.3"); cactusWarConfig.setVersion(version); Modified: jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyWarTask.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyWarTask.java?rev=673511&r1=673510&r2=673511&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyWarTask.java (original) +++ jakarta/cactus/trunk/integration/ant/src/main/java/org/apache/cactus/integration/ant/CactifyWarTask.java Wed Jul 2 14:36:31 2008 @@ -64,6 +64,16 @@ // Constants --------------------------------------------------------------- /** + * Context of the cactus web application. + */ + private String context; + + /** + * Name of the generated web app file. + */ + private String FILE_NAME = "cactus.war"; + + /** * Get some non-crypto-grade randomness from various places. */ private static Random rand = new Random(System.currentTimeMillis() @@ -141,6 +151,7 @@ // Public Methods ---------------------------------------------------------- + /** * [EMAIL PROTECTED] * @see org.apache.tools.ant.Task#execute() @@ -597,4 +608,34 @@ } return result; } + + /** + * Gets the file name. + * + * @return the name of the web app file + */ + public String getFileName() + { + return FILE_NAME; + } + + /** + * Returns the context. + * + * @return <code>java.lang.String</code> + */ + public String getContext() { + return context; + } + + /** + * Sets the context. + * + * @param context + */ + public void setContext(String context) { + this.context = context; + } + + } Modified: jakarta/cactus/trunk/integration/maven2/pom.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/pom.xml?rev=673511&r1=673510&r2=673511&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/maven2/pom.xml (original) +++ jakarta/cactus/trunk/integration/maven2/pom.xml Wed Jul 2 14:36:31 2008 @@ -97,13 +97,13 @@ <dependency> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-core-uberjar</artifactId> - <version>1.0-SNAPSHOT</version> + <version>1.0-alpha-4</version> </dependency> - <dependency> + <!-- >dependency> <groupId>ant</groupId> <artifactId>ant</artifactId> <version>1.6.5</version> - </dependency> + </dependency--> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> @@ -142,7 +142,7 @@ <dependency> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> - <version>1.0-SNAPSHOT</version> + <version>1.0-alpha-4</version> </dependency> </dependencies> <build> Modified: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyEarMojo.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyEarMojo.java?rev=673511&r1=673510&r2=673511&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyEarMojo.java (original) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyEarMojo.java Wed Jul 2 14:36:31 2008 @@ -25,7 +25,6 @@ import java.io.IOException; import java.util.Iterator; -import org.apache.cactus.integration.ant.CactusWar; import org.apache.cactus.integration.api.version.Version; import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.archiver.MavenArchiver; @@ -47,7 +46,6 @@ import org.codehaus.plexus.archiver.ear.EarArchiver; import org.codehaus.plexus.archiver.jar.ManifestException; import org.codehaus.plexus.util.FileUtils; - import org.jdom.JDOMException; /** * A maven2 mojo that injects elements necessary to run Cactus tests into an @@ -62,7 +60,7 @@ /** * Cactus war configuration holder. */ - private CactusWar cactusWar; + private CactifyWarMojo cactusWar; /** * The archive that contains the web-app that should be cactified. @@ -180,8 +178,9 @@ * A helper method to create a temporary file. * @return the cactus.war * @throws MojoExecutionException in case a runtime error occurs. + * @throws MojoFailureException in case a mojo failure occurs. */ - private File createCactusWar() throws MojoExecutionException + private File createCactusWar() throws MojoExecutionException, MojoFailureException { File tmpCactusWar = FileUtils.createTempFile("cactus", "cactus.war", getProject().getBasedir()); @@ -365,14 +364,14 @@ * * @return the CactusWar configuration */ - private CactusWar createCactusWarConfig() + private CactifyWarMojo createCactusWarConfig() { - CactusWar cactusWarConfig = new CactusWar(); + CactifyWarMojo cactusWarConfig = new CactifyWarMojo(); Version version = new Version(); version.setValue("2.3"); cactusWarConfig.setVersion(version); cactusWarConfig.setContext("/cactus"); - cactusWarConfig.setProject(getProject()); + //cactusWarConfig.setProject(getProject()); return cactusWarConfig; } Modified: jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java?rev=673511&r1=673510&r2=673511&view=diff ============================================================================== --- jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java (original) +++ jakarta/cactus/trunk/integration/maven2/src/main/java/org/apache/cactus/maven2/mojos/CactifyWarMojo.java Wed Jul 2 14:36:31 2008 @@ -30,12 +30,11 @@ import java.util.Random; import org.apache.cactus.integration.api.cactify.CactifyUtils; +import org.apache.cactus.integration.api.version.Version; import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.archiver.MavenArchiver; -import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.artifact.factory.ArtifactFactory; -import org.apache.maven.artifact.installer.ArtifactInstallationException; import org.apache.maven.artifact.installer.ArtifactInstaller; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.AbstractMojo; @@ -74,6 +73,15 @@ */ public class CactifyWarMojo extends AbstractMojo { + /** + * Name of the generated web app file. + */ + private String FILE_NAME = "cactus.war"; + + /** + * Context of the cactus web application. + */ + private String context; /** * Get some non-crypto-grade randomness from various places. @@ -678,4 +686,61 @@ logger = new MavenLogger(getLog()); return logger; } + + /** + * Returns the context. + * + * @return <code>java.lang.String</code> + */ + public String getContext() { + return context; + } + + /** + * Sets the context. + * + * @param context + */ + public void setContext(String context) { + this.context = context; + } + + /** + * Sets the web-app version to use when creating a WAR file from scratch. + * + * @param theVersion The version + */ + public final void setVersion(Version theVersion) + { + this.version = theVersion.getValue(); + } + + /** + * Gets the file name. + * + * @return the name of the web app file + */ + public String getFileName() + { + return FILE_NAME; + } + + /** + * Setter method for the destFile. + * + * @param destFile + */ + public void setDestFile(File destFile) { + this.destFile = destFile; + } + + /** + * Adds a configured EjbRef instance. Called by Ant. + * + * @param theEjbRef the EjbRef to add + */ + public final void addConfiguredEjbref(EjbRef theEjbRef) + { + ejbRefs.add(theEjbRef); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]