[jboss-svn-commits] JBL Code SVN: r13800 - labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 26 18:45:29 EDT 2007


Author: steve.ebersole at jboss.com
Date: 2007-07-26 18:45:28 -0400 (Thu, 26 Jul 2007)
New Revision: 13800

Modified:
   labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java
Log:
allow the plugin to be specified w/o specifying configuration

Modified: labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java	2007-07-26 21:40:16 UTC (rev 13799)
+++ labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java	2007-07-26 22:45:28 UTC (rev 13800)
@@ -155,7 +155,9 @@
 	public void execute() throws MojoExecutionException, MojoFailureException {
 		getLog().info( "starting test environment extension mojo" );
 		Environment environment = parseEnvironment();
-		extendTestClasspath( environment );
+		if ( environment != null ) {
+			extendTestClasspath( environment );
+		}
 	}
 
 
@@ -163,6 +165,9 @@
 
 	protected Environment parseEnvironment() throws MojoExecutionException {
 		Document extenderConfigDocument = loadExtenderConfigDocument();
+		if ( extenderConfigDocument == null ) {
+			return null;
+		}
 		EnvironmentBuilder environmentBuilder = new EnvironmentBuilder();
 		Iterator itr = extenderConfigDocument.getRootElement().elementIterator( EnvironmentBuilder.ENVIRONMENT );
 		while ( itr.hasNext() ) {
@@ -178,9 +183,13 @@
 	}
 
 	protected Document loadExtenderConfigDocument() throws MojoExecutionException {
+		if ( extenderConfig == null ) {
+			return null;
+		}
 		File extenderConfigFile = new File( extenderConfig );
 		if ( !extenderConfigFile.exists() ) {
 			getLog().warn( "Could not locate specified extender config file [" + extenderConfig + "]" );
+			return null;
 		}
 
 		return new DocumentLoader( getLog() ).loadDocument( extenderConfigFile );




More information about the jboss-svn-commits mailing list