[jboss-cvs] JBossAS SVN: r79820 - projects/aop/trunk/maven-jbossaop-plugin/src/main/java/org/jboss/maven/plugins.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 21 07:41:18 EDT 2008
Author: stalep
Date: 2008-10-21 07:41:18 -0400 (Tue, 21 Oct 2008)
New Revision: 79820
Modified:
projects/aop/trunk/maven-jbossaop-plugin/src/main/java/org/jboss/maven/plugins/JBossAOPCMojo.java
Log:
added properties handling
Modified: projects/aop/trunk/maven-jbossaop-plugin/src/main/java/org/jboss/maven/plugins/JBossAOPCMojo.java
===================================================================
--- projects/aop/trunk/maven-jbossaop-plugin/src/main/java/org/jboss/maven/plugins/JBossAOPCMojo.java 2008-10-21 11:28:29 UTC (rev 79819)
+++ projects/aop/trunk/maven-jbossaop-plugin/src/main/java/org/jboss/maven/plugins/JBossAOPCMojo.java 2008-10-21 11:41:18 UTC (rev 79820)
@@ -25,7 +25,9 @@
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
+import java.util.Iterator;
import java.util.List;
+import java.util.Properties;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
@@ -119,6 +121,13 @@
*/
private String[] includes;
+ /**
+ * List of properties that can be added when running the application
+ *
+ * @parameter
+ */
+ private Properties properties;
+
private boolean test;
/**
@@ -177,6 +186,23 @@
Commandline cl = new Commandline();
cl.setExecutable("java");
cl.addArguments(new String[] { "-cp", createClassPathList()});
+
+ if(properties != null && !properties.isEmpty())
+ {
+ Iterator iter = properties.keySet().iterator();
+
+ while ( iter.hasNext() )
+ {
+ String key = (String) iter.next();
+ String value = properties.getProperty(key);
+
+ if(key.startsWith("-D"))
+ cl.addArguments(new String[] { key+"="+value});
+ else
+ cl.addArguments(new String[] { "-D"+key+"="+value});
+ }
+ }
+
cl.addArguments(new String[] { "org.jboss.aop.standalone.Compiler"});
if(isVerbose())
cl.addArguments(new String[] { "-verbose"});
More information about the jboss-cvs-commits
mailing list