Author: veithen
Date: Fri Dec  7 16:40:06 2012
New Revision: 1418386

URL: http://svn.apache.org/viewvc?rev=1418386&view=rev
Log:
Prevent the echo-sample tests from creating a server-config.wsdd file in the 
source tree without changing the working directory.

Modified:
    
axis/axis1/java/trunk/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java
    axis/axis1/java/trunk/samples/echo-sample/pom.xml

Modified: 
axis/axis1/java/trunk/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java?rev=1418386&r1=1418385&r2=1418386&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java
 (original)
+++ 
axis/axis1/java/trunk/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java
 Fri Dec  7 16:40:06 2012
@@ -71,10 +71,11 @@ public class GenerateWSDDMojo extends Ab
     private String type;
     
     /**
-     * 
+     * A set of WSDD files (typically generated by maven-wsdl2java-plugin) to 
be merged into the
+     * output WSDD. If this parameter is not set, then the plug-in will just 
generate a default
+     * configuration file.
      * 
      * @parameter
-     * @required
      */
     private File[] files;
     
@@ -148,14 +149,16 @@ public class GenerateWSDDMojo extends Ab
             }
         }
         
-        // Load WSDD files from plug-in configuration
-        for (int i=0; i<files.length; i++) {
-            File file = files[i];
-            getLog().info("Loading " + file);
-            try {
-                deployment.merge(WSDDUtil.load(new 
InputSource(file.toURL().toString())));
-            } catch (Exception ex) {
-                throw new MojoFailureException("Failed to process " + file, 
ex);
+        if (files != null) {
+            // Load WSDD files from plug-in configuration
+            for (int i=0; i<files.length; i++) {
+                File file = files[i];
+                getLog().info("Loading " + file);
+                try {
+                    deployment.merge(WSDDUtil.load(new 
InputSource(file.toURL().toString())));
+                } catch (Exception ex) {
+                    throw new MojoFailureException("Failed to process " + 
file, ex);
+                }
             }
         }
         

Modified: axis/axis1/java/trunk/samples/echo-sample/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/echo-sample/pom.xml?rev=1418386&r1=1418385&r2=1418386&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/echo-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/echo-sample/pom.xml Fri Dec  7 16:40:06 2012
@@ -70,13 +70,32 @@
                 </executions>
             </plugin>
             <plugin>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>maven-wsdd-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <!-- We create a server-config.wsdd file to prevent 
Axis from creating a default one in the source tree -->
+                        <phase>generate-test-sources</phase>
+                        <goals>
+                            <goal>generate-wsdd</goal>
+                        </goals>
+                        <configuration>
+                            <type>server</type>
+                            
<output>${project.build.directory}/server-config.wsdd</output>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <executions>
                     <execution>
                         <id>default-test</id>
                         <configuration>
-                            <!-- Prevent Axis from creating a 
server-config.wsdd file in the source tree -->
-                            
<workingDirectory>${project.build.directory}/work</workingDirectory>
+                            <systemPropertyVariables>
+                                
<axis.ServerConfigFile>${project.build.directory}/server-config.wsdd</axis.ServerConfigFile>
+                            </systemPropertyVariables>
                         </configuration>
                     </execution>
                 </executions>


Reply via email to