From nmaven-commits-return-500-apmail-incubator-nmaven-commits-archive=incubator.apache.org@incubator.apache.org Fri Aug 17 01:57:46 2007 Return-Path: Delivered-To: apmail-incubator-nmaven-commits-archive@locus.apache.org Received: (qmail 56280 invoked from network); 17 Aug 2007 01:57:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Aug 2007 01:57:45 -0000 Received: (qmail 3564 invoked by uid 500); 17 Aug 2007 01:57:43 -0000 Delivered-To: apmail-incubator-nmaven-commits-archive@incubator.apache.org Received: (qmail 3541 invoked by uid 500); 17 Aug 2007 01:57:42 -0000 Mailing-List: contact nmaven-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: nmaven-dev@incubator.apache.org Delivered-To: mailing list nmaven-commits@incubator.apache.org Received: (qmail 3532 invoked by uid 99); 17 Aug 2007 01:57:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 18:57:42 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2007 01:57:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 37F861A98A2; Thu, 16 Aug 2007 18:55:55 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r566902 [36/41] - in /incubator/nmaven/www: ./ ide/ plugins/ plugins/maven-compile-plugin/ plugins/maven-compile-plugin/xref/ plugins/maven-compile-plugin/xref/org/ plugins/maven-compile-plugin/xref/org/apache/ plugins/maven-compile-plugin/... Date: Fri, 17 Aug 2007 01:55:37 -0000 To: nmaven-commits@incubator.apache.org From: sisbell@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070817015555.37F861A98A2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.html URL: http://svn.apache.org/viewvc/incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.html?view=auto&rev=566902 ============================================================================== --- incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.html (added) +++ incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.html Thu Aug 16 18:55:14 2007 @@ -0,0 +1,248 @@ + + + + +PlatformDetector xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.maven.dotnet.plugin.wsdl;
+20  
+21  import org.apache.maven.dotnet.vendor.Vendor;
+22  import org.apache.maven.dotnet.PlatformUnsupportedException;
+23  import org.apache.maven.dotnet.executable.CommandExecutor;
+24  import org.apache.maven.dotnet.executable.ExecutionException;
+25  
+26  import java.io.File;
+27  import java.util.List;
+28  import java.util.ArrayList;
+29  
+30  /**
+31   * Services for detecting the active platform for executables. With the new executable framework, this class may be
+32   * deprecated).
+33   *
+34   * @author Shane Isbell
+35   */
+36  public interface PlatformDetector
+37  {
+38      /**
+39       * Sets the results that are included in the standard output for Microsoft.
+40       *
+41       * @param microsoftContainsString
+42       */
+43      void setMicrosoftContainsString( String microsoftContainsString );
+44  
+45      /**
+46       * Sets the results that are included in the standard output for Mono.
+47       *
+48       * @param monoContainsString
+49       */
+50      void setMonoContainsString( String monoContainsString );
+51  
+52      /**
+53       * Sets the results that are included in the standard output for DotGnu.
+54       *
+55       * @param gnuContainsString
+56       */
+57      void setGnuContainsString( String gnuContainsString );
+58  
+59      /**
+60       * Returns a Vendor instance for the given command and/or netHomePath. If the command is specified, you may need to
+61       * change the expected values of the set[gnu, mono, microsoft]ContainsString method(s) to match the expected output.
+62       * Both command and netHomePath cannot be null.
+63       *
+64       * @param command
+65       * @param netHomePath
+66       * @return a Vendor instance for the given command and/or netHomePath
+67       * @throws org.apache.maven.dotnet.PlatformUnsupportedException
+68       *          if the vendor cannot be matched
+69       */
+70      Vendor getVendorFor( String command, File netHomePath )
+71          throws PlatformUnsupportedException;
+72  
+73      public static class Factory
+74      {
+75          private Factory()
+76          {
+77          }
+78  
+79          public static PlatformDetector createDefaultPlatformDetector()
+80          {
+81              return new PlatformDetector()
+82              {
+83  
+84                  /**
+85                   * String to be matched to standard output for Microsoft
+86                   */
+87                  private String microsoftContainsString = "Microsoft";
+88  
+89                  /**
+90                   * String to be matched to standard output for Mono.
+91                   */
+92                  private String monoContainsString = "Mono";
+93  
+94                  /**
+95                   * String to be matched to standard output for DotGnu.
+96                   */
+97                  private String gnuContainsString = "Southern Storm";
+98  
+99                  public void setMicrosoftContainsString( String microsoftContainsString )
+100                 {
+101                     this.microsoftContainsString = microsoftContainsString;
+102                 }
+103 
+104                 public void setMonoContainsString( String monoContainsString )
+105                 {
+106                     this.monoContainsString = monoContainsString;
+107                 }
+108 
+109                 public void setGnuContainsString( String gnuContainsString )
+110                 {
+111                     this.gnuContainsString = gnuContainsString;
+112                 }
+113 
+114                 public Vendor getVendorFor( String command, File netHomePath )
+115                     throws PlatformUnsupportedException
+116                 {
+117                     String netHome = ( netHomePath == null ) ? null : netHomePath.getAbsolutePath();
+118                     if ( isEmpty( command ) && isEmpty( netHome ) )
+119                     {
+120                         throw new PlatformUnsupportedException(
+121                             "NMAVEN-042-000: Both command and netHome params cannot be null or empty" );
+122                     }
+123                     else if ( !isEmpty( command ) && isEmpty( netHome ) )
+124                     {
+125                         return getVendorForCommand( command );
+126                     }
+127                     else if ( isEmpty( command ) && !isEmpty( netHome ) )
+128                     {
+129                         return getVendorFromPath( netHome );
+130                     }
+131                     else if ( !isEmpty( command ) && !isEmpty( netHome ) )
+132                     {
+133                         try
+134                         {
+135                             return getVendorFromPath( netHome );
+136                         }
+137                         catch ( PlatformUnsupportedException e )
+138                         {
+139 
+140                             //log.debug(e);
+141                         }
+142                         try
+143                         {
+144                             return getVendorForCommand( netHome + File.separator + "bin" + File.separator + command );
+145                         }
+146                         catch ( PlatformUnsupportedException e )
+147                         {
+148                             throw new PlatformUnsupportedException( "" );
+149                         }
+150                     }
+151                     return null;
+152                 }
+153 
+154                 /**
+155                  * Determine the vendor based on executing the command and matching the standard output.
+156                  *
+157                  * @param command
+158                  * @return vendor instance
+159                  * @throws org.apache.maven.dotnet.PlatformUnsupportedException
+160                  *          if the platform cannot be matched.
+161                  */
+162                 private Vendor getVendorForCommand( String command )
+163                     throws PlatformUnsupportedException
+164                 {
+165                     CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
+166                     //commandExecutor.setLogger(logger);
+167                     try
+168                     {
+169                         List<String> commands = new ArrayList<String>();
+170                         commandExecutor.executeCommand( command, commands );
+171                     }
+172                     catch ( ExecutionException e )
+173                     {
+174                         throw new PlatformUnsupportedException( "", e );
+175                     }
+176                     String results = commandExecutor.getStandardOut();
+177                     if ( results.contains( microsoftContainsString ) )
+178                     {
+179                         return Vendor.MICROSOFT;
+180                     }
+181                     else if ( results.contains( monoContainsString ) )
+182                     {
+183                         return Vendor.MONO;
+184                     }
+185                     else if ( results.contains( gnuContainsString ) || results.contains( "cscc" ) )
+186                     {//cscc does not contain vendor name
+187                         return Vendor.DOTGNU;
+188                     }
+189                     else
+190                     {
+191                         throw new PlatformUnsupportedException(
+192                             "NMAVEN-042-001: Platform not supported: Results = " + results );
+193                     }
+194                 }
+195 
+196                 /**
+197                  * Determines the vendor based on the path of the executable
+198                  *
+199                  * @param path
+200                  * @return vendor
+201                  * @throws PlatformUnsupportedException
+202                  */
+203                 private Vendor getVendorFromPath( String path )
+204                     throws PlatformUnsupportedException
+205                 {
+206                     if ( !new File( path ).exists() )
+207                     {
+208                         throw new PlatformUnsupportedException(
+209                             "NMAVEN-042-002: Unable to locate path: Path = " + path );
+210                     }
+211 
+212                     if ( path.contains( "Microsoft.NET" ) )
+213                     {
+214                         return Vendor.MICROSOFT;
+215                     }
+216                     else if ( path.contains( "Mono" ) )
+217                     {
+218                         return Vendor.MONO;
+219                     }
+220                     else if ( path.contains( "Portable.NET" ) )
+221                     {
+222                         return Vendor.DOTGNU;
+223                     }
+224                     throw new PlatformUnsupportedException( "NMAVEN-042-003: Platform not supported: Path " + path );
+225                 }
+226 
+227                 private boolean isEmpty( String value )
+228                 {
+229                     return ( value == null || value.trim().equals( "" ) );
+230                 }
+231             };
+232         }
+233     }
+234 }
+
+
+ + Added: incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Proxy.html URL: http://svn.apache.org/viewvc/incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Proxy.html?view=auto&rev=566902 ============================================================================== --- incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Proxy.html (added) +++ incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Proxy.html Thu Aug 16 18:55:14 2007 @@ -0,0 +1,104 @@ + + + + +Proxy xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.maven.dotnet.plugin.wsdl;
+20  
+21  /**
+22   * Holds proxy information needed to access WSDL host.
+23   *
+24   * @author Shane Isbell
+25   */
+26  public class Proxy
+27  {
+28  
+29      private String id;
+30  
+31      private boolean hashPassword;
+32  
+33      private String hashAlg;
+34  
+35      public String getId()
+36      {
+37          return id;
+38      }
+39  
+40      public void setId( String id )
+41      {
+42          this.id = id;
+43      }
+44  
+45      public boolean isHashPassword()
+46      {
+47          return hashPassword;
+48      }
+49  
+50      public void setHashPassword( boolean hashPassword )
+51      {
+52          this.hashPassword = hashPassword;
+53      }
+54  
+55      public String getHashAlg()
+56      {
+57          return hashAlg;
+58      }
+59  
+60      public void setHashAlg( String hashAlg )
+61      {
+62          this.hashAlg = hashAlg;
+63      }
+64  
+65      public boolean equals( Object o )
+66      {
+67          if ( this == o )
+68          {
+69              return true;
+70          }
+71          if ( o == null || getClass() != o.getClass() )
+72          {
+73              return false;
+74          }
+75  
+76          final Proxy proxy = (Proxy) o;
+77  
+78          if ( !id.equals( proxy.id ) )
+79          {
+80              return false;
+81          }
+82  
+83          return true;
+84      }
+85  
+86      public int hashCode()
+87      {
+88          return id.hashCode();
+89      }
+90  }
+
+
+ + Added: incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Server.html URL: http://svn.apache.org/viewvc/incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Server.html?view=auto&rev=566902 ============================================================================== --- incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Server.html (added) +++ incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/Server.html Thu Aug 16 18:55:14 2007 @@ -0,0 +1,109 @@ + + + + +Server xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.maven.dotnet.plugin.wsdl;
+20  
+21  /**
+22   * Holds server information of WSDL host.
+23   *
+24   * @author Shane Isbell
+25   */
+26  public class Server
+27  {
+28  
+29      private String id;
+30  
+31      private boolean hashPassword;
+32  
+33      private String hashAlg;
+34  
+35      public String getId()
+36      {
+37          return id;
+38      }
+39  
+40      public void setId( String id )
+41      {
+42          this.id = id;
+43      }
+44  
+45      public boolean isHashPassword()
+46      {
+47          return hashPassword;
+48      }
+49  
+50      public void setHashPassword( boolean hashPassword )
+51      {
+52          this.hashPassword = hashPassword;
+53      }
+54  
+55      public String getHashAlg()
+56      {
+57          return hashAlg;
+58      }
+59  
+60      public void setHashAlg( String hashAlg )
+61      {
+62          this.hashAlg = hashAlg;
+63      }
+64  
+65      public boolean equals( Object o )
+66      {
+67          if ( this == o )
+68          {
+69              return true;
+70          }
+71          if ( o == null || getClass() != o.getClass() )
+72          {
+73              return false;
+74          }
+75  
+76          final Server server = (Server) o;
+77  
+78          if ( !id.equals( server.id ) )
+79          {
+80              return false;
+81          }
+82  
+83          return true;
+84      }
+85  
+86      public int hashCode()
+87      {
+88          return id.hashCode();
+89      }
+90  
+91      public String toString()
+92      {
+93          return "id = " + id;
+94      }
+95  }
+
+
+ + Added: incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.html URL: http://svn.apache.org/viewvc/incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.html?view=auto&rev=566902 ============================================================================== --- incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.html (added) +++ incubator/nmaven/www/plugins/maven-wsdl-plugin/xref/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.html Thu Aug 16 18:55:14 2007 @@ -0,0 +1,501 @@ + + + + +WsdlGeneratorMojo xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   *   http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.maven.dotnet.plugin.wsdl;
+20  
+21  import org.apache.maven.plugin.AbstractMojo;
+22  import org.apache.maven.plugin.MojoExecutionException;
+23  import org.apache.maven.settings.Server;
+24  import org.apache.maven.settings.Proxy;
+25  import org.apache.maven.dotnet.vendor.Vendor;
+26  import org.apache.maven.dotnet.executable.CommandExecutor;
+27  import org.apache.maven.dotnet.executable.ExecutionException;
+28  import org.apache.maven.dotnet.PlatformUnsupportedException;
+29  
+30  import java.util.List;
+31  import java.util.ArrayList;
+32  import java.security.MessageDigest;
+33  import java.security.NoSuchAlgorithmException;
+34  import java.io.File;
+35  import java.net.URL;
+36  import java.net.MalformedURLException;
+37  
+38  
+39  /**
+40   * Generates WSDL class
+41   *
+42   * @author Shane Isbell
+43   * @goal wsdl
+44   * @phase process-sources
+45   * @description Generates WSDL class
+46   */
+47  public class WsdlGeneratorMojo
+48      extends AbstractMojo
+49  {
+50  
+51      /**
+52       * The directory to place the generated binding classes.
+53       *
+54       * @parameter expression="${outputDirectory}" default-value = "${project.build.directory}${file.separator}build-sources"
+55       * @required
+56       */
+57      private String outputDirectory;
+58  
+59      /**
+60       * Paths (or URLs) of the WSDL files.
+61       *
+62       * @parameter expression="${paths}"
+63       * @required
+64       */
+65      private String[] paths;
+66  
+67      /**
+68       * Language of the WSDL binding. Default value is CS (CSHARP).
+69       *
+70       * @parameter expression="${language}" default-value="CS"
+71       */
+72      private String language;
+73  
+74      /**
+75       * Turns on type sharing feature. Not supported for MONO.
+76       *
+77       * @parameter expression="${sharetypes}" default-value="false"
+78       */
+79      private boolean sharetypes;
+80  
+81      /**
+82       * Displays extra information when the sharetypes switch is specified. Not supported for MONO.
+83       *
+84       * @parameter expression="${verbose}" default-value="false"
+85       */
+86      private boolean verbose;
+87  
+88      /**
+89       * Generates fields instead of properties.
+90       *
+91       * @parameter expression="${fields}" default-value="false"
+92       */
+93      private boolean fields;
+94  
+95      /**
+96       * Generates explicit order identifiers on all particle members. Not supported for MONO.
+97       *
+98       * @parameter expression = "${order}" default-value = "false"
+99       */
+100     private boolean order;
+101 
+102     /**
+103      * Generates the INotifyPropertyChanged interface to enable data binding. Not supported for MONO.
+104      *
+105      * @parameter expression="${enableDataBinding}" default-value="false"
+106      */
+107     private boolean enableDataBinding;
+108 
+109     /**
+110      * Namespace of the WSDL binding. Default value is ${project.groupId}
+111      *
+112      * @parameter expression="${namespace}" default-value="${project.groupId}"
+113      */
+114     private String namespace;
+115 
+116     /**
+117      * Override the default protocol.
+118      *
+119      * @parameter expression="${protocol}"
+120      */
+121     private String protocol;
+122 
+123     /**
+124      * The server to retrieve the WSDL from.
+125      *
+126      * @parameter
+127      */
+128     private org.apache.maven.dotnet.plugin.wsdl.Server server;
+129 
+130     /**
+131      * The proxy server
+132      *
+133      * @parameter
+134      */
+135     private org.apache.maven.dotnet.plugin.wsdl.Proxy proxy;
+136 
+137     /**
+138      * Server values from the settings.xml file.
+139      *
+140      * @parameter expression="${settings.servers}"
+141      * @required
+142      */
+143     private List<Server> servers;
+144 
+145     /**
+146      * Server values from the settings.xml file.
+147      *
+148      * @parameter expression="${settings.proxies}"
+149      * @required
+150      */
+151     private List<Proxy> proxies;
+152 
+153     /**
+154      * @parameter expression="${netHome}"
+155      */
+156     private String netHome;
+157 
+158     /**
+159      * Generates server implementation
+160      *
+161      * @parameter expression="${serverInterface}"  default-value ="false"
+162      */
+163     private boolean serverInterface;
+164 
+165     /**
+166      * Tells the plugin to ignore options not appropriate to the vendor.
+167      *
+168      * @parameter expresion ="${ignoreUnusedOptions}" default-value="false"
+169      */
+170     private boolean ignoreUnusedOptions;
+171 
+172     public void execute()
+173         throws MojoExecutionException
+174     {
+175         Vendor vendor = getCompilerVendor();
+176         List<String> commands = getCommandsFor( vendor );
+177 
+178         getLog().debug( "NMAVEN-1300-000: Commands = " + commands.toString() );
+179         CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
+180         try
+181         {
+182             commandExecutor.executeCommand( getExecutableFor( vendor, netHome ), commands );
+183             for ( String path : paths )
+184             {
+185                 getLog().info( "NMAVEN-1300-008: Generated WSDL: File = " + outputDirectory + File.separator +
+186                     getFileNameFor( path ) );
+187             }
+188 
+189         }
+190         catch ( ExecutionException e )
+191         {
+192             //TODO: This is a hack to get around the fact that MONO returns a result=1 on warnings and MS returns a result=1 on errors.
+193             //I don't want to fail on MONO warning here.
+194             if ( ( vendor.equals( Vendor.MONO ) && commandExecutor.getResult() > 1 ) ||
+195                 vendor.equals( Vendor.MICROSOFT ) )
+196             {
+197                 throw new MojoExecutionException( "NMAVEN-1300-001: Result = " + commandExecutor.getResult(), e );
+198             }
+199         }
+200     }
+201 
+202     public String getExecutableFor( Vendor vendor, String home )
+203     {
+204         String executable = ( vendor.equals( Vendor.MICROSOFT ) ) ? "wsdl" : "wsdl2";
+205         return ( !isEmpty( home ) ) ? home + File.separator + "bin" + File.separator + executable : executable;
+206     }
+207 
+208     public List<String> getCommandsFor( Vendor vendor )
+209         throws MojoExecutionException
+210     {
+211         String commandFlag = vendor.equals( Vendor.MICROSOFT ) ? "/" : "-";
+212 
+213         List<String> commands = new ArrayList<String>();
+214         populateServerCommands( commands, commandFlag );
+215         populateProxyCommands( commands, commandFlag );
+216         commands.add( commandFlag + "language:" + language );
+217         commands.add( commandFlag + "namespace:" + namespace );
+218         commands.add( commandFlag + "fields:" + fields );
+219         if ( !isEmpty( protocol ) )
+220         {
+221             commands.add( commandFlag + "protocol:" + protocol );
+222         }
+223 
+224         for ( String path : paths )
+225         {
+226             commands.add( commandFlag + "out:" + outputDirectory + getFileNameFor( path ) );
+227         }
+228 
+229         for ( String path : paths )
+230         {
+231             commands.add( new File( path ).getAbsolutePath() );
+232         }
+233 
+234         if ( vendor.equals( Vendor.MONO ) )
+235         {
+236             if ( serverInterface )
+237             {
+238                 commands.add( "-server" );
+239             }
+240             if ( ( fields || enableDataBinding || order || sharetypes || verbose ) )
+241             {
+242                 if ( !ignoreUnusedOptions )
+243                 {
+244                     throw new MojoExecutionException( "NMAVEN-1300-005: Illegal Option(s) for Mono" );
+245                 }
+246                 else
+247                 {
+248                     getLog().warn(
+249                         "NMAVEN-1300-002: Your pom.xml contains an option that is not supported by MONO: Your application" +
+250                             " artifact will differ dependening on compiler/platform and may have different behavior." );
+251                 }
+252             }
+253         }
+254         else
+255         {
+256             if ( serverInterface )
+257             {
+258                 commands.add( "/server" );
+259             }
+260             if ( enableDataBinding )
+261             {
+262                 commands.add( "/enableDataBinding" );
+263             }
+264             if ( sharetypes )
+265             {
+266                 commands.add( "/sharetypes" );
+267             }
+268             if ( verbose )
+269             {
+270                 commands.add( "/verbose" );
+271             }
+272             if ( order )
+273             {
+274                 commands.add( "/order" );
+275             }
+276         }
+277         return commands;
+278     }
+279 
+280     private boolean isURL( String path )
+281     {
+282         try
+283         {
+284             new URL( path );
+285         }
+286         catch ( MalformedURLException e )
+287         {
+288             return false;
+289         }
+290         return true;
+291     }
+292 
+293     private String getFileNameFor( String path )
+294     {
+295         String wsdlName;
+296         if ( isURL( path ) )
+297         {
+298             wsdlName = path.substring( path.lastIndexOf( "/" ), path.length() );
+299         }
+300         else
+301         {
+302             if ( path.contains( "/" ) )
+303             {
+304                 wsdlName = path.substring( path.lastIndexOf( "/" ), path.length() );
+305             }
+306             else if ( path.contains( "\\" ) )
+307             {
+308                 wsdlName = path.substring( path.lastIndexOf( "\\" ), path.length() );
+309             }
+310             else
+311             {
+312                 wsdlName = path;
+313             }
+314         }
+315         return wsdlName.substring( 0, wsdlName.lastIndexOf( "." ) ) + "." + language.toLowerCase();
+316     }
+317 
+318     private void populateProxyCommands( List<String> commands, String commandFlag )
+319         throws MojoExecutionException
+320     {
+321         if ( proxy != null )
+322         {
+323             Proxy mProxy = getProxyFor( proxy.getId() );
+324             if ( mProxy != null )
+325             {
+326                 getLog().debug( "NMAVEN-1300-003: Found proxy: ID = " + mProxy.getId() );
+327                 String username = mProxy.getUsername();
+328                 String password = mProxy.getPassword();
+329                 boolean isHashed = proxy.isHashPassword();
+330                 if ( !isEmpty( password ) && isHashed )
+331                 {
+332                     String alg = proxy.getHashAlg();
+333                     if ( isEmpty( alg ) )
+334                     {
+335                         alg = "SHA1";
+336                     }
+337                     try
+338                     {
+339                         password = new String( MessageDigest.getInstance( alg ).digest( password.getBytes() ) );
+340                     }
+341                     catch ( NoSuchAlgorithmException e )
+342                     {
+343                         throw new MojoExecutionException(
+344                             "NMAVEN-1300-004: No Such Algorithm for hashing the password: " + "Algorithm = " + alg, e );
+345                     }
+346                 }
+347                 String proxyHost = mProxy.getHost();
+348                 int proxyPort = mProxy.getPort();
+349                 String proxyProtocol = mProxy.getProtocol();
+350 
+351                 StringBuffer proxyUrl = new StringBuffer();
+352                 if ( !isEmpty( proxyProtocol ) )
+353                 {
+354                     proxyUrl.append( proxyProtocol ).append( "://" );
+355                 }
+356                 if ( !isEmpty( proxyHost ) )
+357                 {
+358                     proxyUrl.append( proxyHost );
+359                 }
+360                 if ( proxyPort > 0 )
+361                 {
+362                     proxyUrl.append( ":" ).append( proxyPort );
+363                 }
+364                 if ( proxyUrl.length() != 0 )
+365                 {
+366                     commands.add( commandFlag + "proxy:" + proxyUrl.toString() );
+367                 }
+368                 if ( !isEmpty( username ) )
+369                 {
+370                     commands.add( commandFlag + "proxyusername:" + username );
+371                 }
+372                 if ( !isEmpty( password ) )
+373                 {
+374                     commands.add( commandFlag + "proxypassword:" + password );
+375                 }
+376             }
+377         }
+378     }
+379 
+380     private void populateServerCommands( List<String> commands, String commandFlag )
+381         throws MojoExecutionException
+382     {
+383         if ( server != null )
+384         {
+385             Server mServer = getServerFor( server.getId() );
+386             if ( mServer != null )
+387             {
+388                 String username = mServer.getUsername();
+389                 String password = mServer.getPassword();
+390                 boolean isHashed = server.isHashPassword();
+391                 if ( !isEmpty( password ) && isHashed )
+392                 {
+393                     String alg = server.getHashAlg();
+394                     if ( isEmpty( alg ) )
+395                     {
+396                         alg = "SHA1";
+397                     }
+398                     try
+399                     {
+400                         password = new String( MessageDigest.getInstance( alg ).digest( password.getBytes() ) );
+401                     }
+402                     catch ( NoSuchAlgorithmException e )
+403                     {
+404                         throw new MojoExecutionException(
+405                             "NMAVEN-1300-005: No Such Algorithm for hashing the password: " + "Algorithm = " + alg, e );
+406                     }
+407                 }
+408                 if ( !isEmpty( username ) )
+409                 {
+410                     commands.add( commandFlag + "username:" + username );
+411                 }
+412                 if ( !isEmpty( password ) )
+413                 {
+414                     commands.add( commandFlag + "password:" + password );
+415                 }
+416             }
+417         }
+418     }
+419 
+420     private Vendor getCompilerVendor()
+421         throws MojoExecutionException
+422     {
+423         Vendor vendor;
+424         PlatformDetector platformDetector = PlatformDetector.Factory.createDefaultPlatformDetector();
+425         if ( isEmpty( netHome ) )
+426         {
+427             try
+428             {
+429                 vendor = platformDetector.getVendorFor( "wsdl", null );
+430             }
+431             catch ( PlatformUnsupportedException e )
+432             {
+433                 throw new MojoExecutionException( "NMAVEN-1300-009", e );
+434             }
+435         }
+436         else
+437         {
+438             File file = new File( netHome );
+439             if ( !file.exists() )
+440             {
+441                 throw new MojoExecutionException(
+442                     "NMAVEN-1300-006: Unable to locate netHome - make sure that it exists:" + " Home = " + netHome );
+443             }
+444             try
+445             {
+446                 vendor = platformDetector.getVendorFor( null, new File(
+447                     file.getAbsolutePath() + File.separator + "bin" + File.separator + "wsdl" ) );
+448             }
+449             catch ( PlatformUnsupportedException e )
+450             {
+451                 throw new MojoExecutionException( "NMAVEN-1300-010", e );
+452             }
+453 
+454         }
+455         getLog().info( "NMAVEN-1300-007: WSDL Vendor found: " + vendor.getVendorName() );
+456         return vendor;
+457     }
+458 
+459     private Proxy getProxyFor( String id )
+460     {
+461         for ( Proxy proxy : proxies )
+462         {
+463             if ( proxy.getId().trim().equals( id.trim() ) )
+464             {
+465                 return proxy;
+466             }
+467         }
+468         return null;
+469     }
+470 
+471     private Server getServerFor( String id )
+472     {
+473         for ( Server server : servers )
+474         {
+475             if ( server.getId().trim().equals( id.trim() ) )
+476             {
+477                 return server;
+478             }
+479         }
+480         return null;
+481     }
+482 
+483     private boolean isEmpty( String value )
+484     {
+485         return ( value == null || value.trim().equals( "" ) );
+486     }
+487 }
+
+
+ +