labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r762972 - in /labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven: MagmaAjcCompleteCompileMojo.java MagmaJettyRunWar.java MagmaWarExploded.java MagmaWarPackaged.java
Date Tue, 07 Apr 2009 21:28:55 GMT
Author: simoneg
Date: Tue Apr  7 21:28:53 2009
New Revision: 762972

URL: http://svn.apache.org/viewvc?rev=762972&view=rev
Log:
LABS-333 : use same variable names and defaults as the default magma war plugin

Modified:
    labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaAjcCompleteCompileMojo.java
    labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaJettyRunWar.java
    labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarExploded.java
    labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarPackaged.java

Modified: labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaAjcCompleteCompileMojo.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaAjcCompleteCompileMojo.java?rev=762972&r1=762971&r2=762972&view=diff
==============================================================================
--- labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaAjcCompleteCompileMojo.java
(original)
+++ labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaAjcCompleteCompileMojo.java
Tue Apr  7 21:28:53 2009
@@ -66,6 +66,13 @@
 
 	protected PlexusContainer container;
 	protected File baseout;
+
+    /**
+     * Where to place the weaved jar files.
+     * 
+     * @parameter expression="${project.build.directory}/jars"
+     * @required
+     */	
 	protected File destjarfolder;
 
 	protected Collection getRelevantArtifacts() {
@@ -99,7 +106,6 @@
 
 		getLog().info("Weaving dependency JARs one by one");
 		
-		destjarfolder = new File(baseout.getParentFile(), "jars");
 		destjarfolder.mkdirs();
 		try {
 			FileUtils.cleanDirectory(destjarfolder);

Modified: labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaJettyRunWar.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaJettyRunWar.java?rev=762972&r1=762971&r2=762972&view=diff
==============================================================================
--- labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaJettyRunWar.java
(original)
+++ labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaJettyRunWar.java
Tue Apr  7 21:28:53 2009
@@ -63,7 +63,7 @@
         // Create the webapp
         WebAppContext webapp = new WebAppContext();
         webapp.setContextPath(this.contextPath);
-        webapp.setWar(super.warfolder.getAbsolutePath());
+        webapp.setWar(super.webappDirectory.getAbsolutePath());
         if (!tmpDirectory.exists()) {
         	if (!tmpDirectory.mkdirs()) {
         		throw new MojoExecutionException("Cannot create temporary directory " + tmpDirectory.getAbsolutePath());
@@ -74,7 +74,7 @@
         WebAppClassLoader cl = null;
 		try {
 			cl = new WebAppClassLoader(webapp);
-			cl.addJars(Resource.newResource(new File(super.warfolder, "WEB-INF/libs/").toURI().toURL()));
+			cl.addJars(Resource.newResource(new File(super.webappDirectory, "WEB-INF/libs/").toURI().toURL()));
 	        webapp.setClassLoader(cl);
 		} catch (Exception e1) {
 			throw new MojoExecutionException("Error setting up classloader", e1);

Modified: labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarExploded.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarExploded.java?rev=762972&r1=762971&r2=762972&view=diff
==============================================================================
--- labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarExploded.java
(original)
+++ labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarExploded.java
Tue Apr  7 21:28:53 2009
@@ -15,7 +15,13 @@
 */
 public class MagmaWarExploded extends MagmaAjcCompleteCompileMojo {
 
-	protected File warfolder;
+    /**
+     * Directory in which to build the war structure.
+     * 
+     * @parameter expression="${project.build.directory}/${project.build.finalName}"
+     * @required
+     */		
+	protected File webappDirectory;
 
 	@Override
 	public void execute() throws MojoExecutionException, MojoFailureException {
@@ -24,11 +30,10 @@
 		project.setPackaging("war");
 		
 		getLog().info("Creating WAR file structure");
-		warfolder = new File(baseout.getParentFile(), "war-exploded");
-		warfolder.mkdirs();
+		webappDirectory.mkdirs();
 		try {
-			FileUtils.cleanDirectory(warfolder);
-			File webinf = new File(warfolder, "WEB-INF");
+			FileUtils.cleanDirectory(webappDirectory);
+			File webinf = new File(webappDirectory, "WEB-INF");
 			webinf.mkdir();
 			
 			// Copy weaved jars into lib folder
@@ -49,7 +54,7 @@
 			// Override everywthing with custom website if any
 			File srcwebsite = new File(project.getBasedir(), "src/main/website");
 			if (srcwebsite.exists()) {
-				FileUtils.copyDirectoryStructure(srcwebsite, warfolder);
+				FileUtils.copyDirectoryStructure(srcwebsite, webappDirectory);
 			}
 		} catch (Exception e) {
 			throw new MojoExecutionException("Error creating war folder", e);

Modified: labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarPackaged.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarPackaged.java?rev=762972&r1=762971&r2=762972&view=diff
==============================================================================
--- labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarPackaged.java
(original)
+++ labs/magma/trunk/maven-magma-plugin/src/main/java/org/apache/magma/tools/maven/MagmaWarPackaged.java
Tue Apr  7 21:28:53 2009
@@ -17,23 +17,28 @@
 */
 public class MagmaWarPackaged extends MagmaWarExploded {
 
+    /**
+     * Directory in which to build the war structure.
+     * 
+     * @parameter expression="${project.build.directory}/${project.build.finalName}.war"
+     * @required
+     */			
+	protected File warName;
+	
 	@Override
 	public void execute() throws MojoExecutionException, MojoFailureException {
 		super.execute();
-
-		File destjar = new File(baseout.getParentFile(), project.getArtifactId() + ".war");
 		try {
 			MavenArchiver archiver = new MavenArchiver();
 			JarArchiver jarArchiver = (JarArchiver) container.lookup("org.codehaus.plexus.archiver.Archiver","jar");
 			archiver.setArchiver(jarArchiver);
-			archiver.setOutputFile(destjar);
-			archiver.getArchiver().addDirectory(warfolder);
+			archiver.setOutputFile(warName);
+			archiver.getArchiver().addDirectory(webappDirectory);
 			MavenArchiveConfiguration conf = new MavenArchiveConfiguration();
 			archiver.createArchive(project, conf);
 		} catch (Exception e) {
-			throw new RuntimeException("Error creating WAR file " + destjar.getAbsolutePath(), e);
+			throw new RuntimeException("Error creating WAR file " + warName.getAbsolutePath(), e);
 		}
-	
 	}
 	
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message