incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r512336 [1/2] - in /incubator/nmaven/branches/SI_IDE/plugins: maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/ maven-settings-plugin/src/ma...
Date Tue, 27 Feb 2007 17:45:37 GMT
Author: sisbell
Date: Tue Feb 27 09:45:32 2007
New Revision: 512336

URL: http://svn.apache.org/viewvc?view=rev&rev=512336
Log:
Reformatted plugin classes to follow code conventions.

Modified:
    incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceCopierMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceGeneratorMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependency.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-settings-plugin/src/main/java/org/apache/maven/dotnet/plugin/settings/SettingsGeneratorMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/test/TesterMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetAchiverMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetArchiveDeployerMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Proxy.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Server.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XmlToXsdGeneratorMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XsdGeneratorMojo.java

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceCopierMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceCopierMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceCopierMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceCopierMojo.java Tue Feb 27 09:45:32 2007
@@ -39,7 +39,9 @@
  * @goal copy-resources
  * @phase process-resources
  */
-public class ResourceCopierMojo extends AbstractMojo {
+public class ResourceCopierMojo
+    extends AbstractMojo
+{
 
     /**
      * The maven project.
@@ -49,58 +51,84 @@
      */
     private MavenProject project;
 
-    public void execute() throws MojoExecutionException {
+    public void execute()
+        throws MojoExecutionException
+    {
         String targetDirectory = project.getBuild().getDirectory();
         List<Resource> resources = project.getResources();
-        if(resources.isEmpty()) {
-            getLog().info("NMAVEN-1500-000: No resources found");
+        if ( resources.isEmpty() )
+        {
+            getLog().info( "NMAVEN-1500-000: No resources found" );
             return;
         }
-        for(Resource resource: resources) {
-            if(!new File(resource.getDirectory()).exists()) continue;
-            copyResourceDirectory(resource.getDirectory(), targetDirectory, resource.getIncludes(),
-                    resource.getExcludes());
-        }
-        try {
-            FileUtils.copyDirectory(new File(project.getBasedir() + File.separator + "src/main/config"),
-                    new File(project.getBuild().getDirectory()), "*.exe.config", null);
-        } catch (IOException e) {
-           throw new MojoExecutionException("NMAVEN-1500-004: Failed to copy config file.", e);
+        for ( Resource resource : resources )
+        {
+            if ( !new File( resource.getDirectory() ).exists() )
+            {
+                continue;
+            }
+            copyResourceDirectory( resource.getDirectory(), targetDirectory, resource.getIncludes(),
+                                   resource.getExcludes() );
+        }
+        try
+        {
+            FileUtils.copyDirectory( new File( project.getBasedir() + File.separator + "src/main/config" ),
+                                     new File( project.getBuild().getDirectory() ), "*.exe.config", null );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1500-004: Failed to copy config file.", e );
         }
     }
 
-    private void copyResourceDirectory(String sourceDirectory, String outputDirectory, List includes,
-                                       List excludes) throws MojoExecutionException {
+    private void copyResourceDirectory( String sourceDirectory, String outputDirectory, List includes, List excludes )
+        throws MojoExecutionException
+    {
         DirectoryScanner directoryScanner = new DirectoryScanner();
-        directoryScanner.setBasedir(sourceDirectory);
-        if(!includes.isEmpty()) directoryScanner.setIncludes(listAsStringArray(includes));
-        if(!excludes.isEmpty()) directoryScanner.setExcludes(listAsStringArray(excludes));
+        directoryScanner.setBasedir( sourceDirectory );
+        if ( !includes.isEmpty() )
+        {
+            directoryScanner.setIncludes( listAsStringArray( includes ) );
+        }
+        if ( !excludes.isEmpty() )
+        {
+            directoryScanner.setExcludes( listAsStringArray( excludes ) );
+        }
         directoryScanner.addDefaultExcludes();
         directoryScanner.scan();
         String[] files = directoryScanner.getIncludedFiles();
-        for (String file : files) {
-            File sourceFile = new File(sourceDirectory + File.separator + file);
+        for ( String file : files )
+        {
+            File sourceFile = new File( sourceDirectory + File.separator + file );
             File destinationFile =
-                    new File(outputDirectory + File.separator + "assembly-resources" + File.separator +  file);
-            try {
-                FileUtils.copyFile(sourceFile, destinationFile);
-                getLog().debug("NMAVEN-1500-001: Copied Resource File: Source File = " + sourceFile.getAbsolutePath() +
-                        ", Destination File = " + destinationFile.getAbsolutePath());
-            } catch (IOException e) {
-                throw new MojoExecutionException("NMAVEN-1500-002: Unable to copy resource file: Source File = " +
-                        sourceFile.getAbsolutePath(), e);
+                new File( outputDirectory + File.separator + "assembly-resources" + File.separator + file );
+            try
+            {
+                FileUtils.copyFile( sourceFile, destinationFile );
+                getLog().debug( "NMAVEN-1500-001: Copied Resource File: Source File = " + sourceFile.getAbsolutePath() +
+                    ", Destination File = " + destinationFile.getAbsolutePath() );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException(
+                    "NMAVEN-1500-002: Unable to copy resource file: Source File = " + sourceFile.getAbsolutePath(), e );
             }
         }
-        getLog().info("NMAVEN-1500-003: Copied resource directory: Number of Resources = " + files.length
-            + ", Resource Directory = " + sourceDirectory
-            + ", Destination Directory = " + outputDirectory + File.separator + "assembly-resources");
+        getLog().info( "NMAVEN-1500-003: Copied resource directory: Number of Resources = " + files.length +
+            ", Resource Directory = " + sourceDirectory + ", Destination Directory = " + outputDirectory + File
+            .separator + "assembly-resources" );
     }
 
-    private String[] listAsStringArray(List list) {
-        if(list == null) return new String[0];
+    private String[] listAsStringArray( List list )
+    {
+        if ( list == null )
+        {
+            return new String[0];
+        }
         String[] target = new String[list.size()];
         int j = 0;
-        for(Iterator i = list.iterator(); i.hasNext(); j++) {
+        for ( Iterator i = list.iterator(); i.hasNext(); j++ )
+        {
             target[j] = (String) i.next();
         }
         return target;

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceGeneratorMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceGeneratorMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-resgen-plugin/src/main/java/org/apache/maven/dotnet/plugin/resgen/ResourceGeneratorMojo.java Tue Feb 27 09:45:32 2007
@@ -40,7 +40,9 @@
  * @goal generate
  * @phase process-resources
  */
-public class ResourceGeneratorMojo extends AbstractMojo {
+public class ResourceGeneratorMojo
+    extends AbstractMojo
+{
 
     /**
      * @parameter expression="${settings.localRepository}"
@@ -72,7 +74,7 @@
     private String vendor;
 
     /**
-     * @parameter expression = "${frameworkVersion}" 
+     * @parameter expression = "${frameworkVersion}"
      */
     private String frameworkVersion;
 
@@ -96,61 +98,86 @@
      */
     private org.apache.maven.dotnet.NMavenRepositoryRegistry nmavenRegistry;
 
-    public void execute() throws MojoExecutionException {
+    public void execute()
+        throws MojoExecutionException
+    {
 
-        if (System.getProperty("bootstrap") != null)
+        if ( System.getProperty( "bootstrap" ) != null )
+        {
             return;
+        }
 
-        File sourceDirectory = new File(project.getBuild().getDirectory() + File.separator + "assembly-resources"
-                + File.separator + "resgen");
-        if (!sourceDirectory.exists())
+        File sourceDirectory = new File(
+            project.getBuild().getDirectory() + File.separator + "assembly-resources" + File.separator + "resgen" );
+        if ( !sourceDirectory.exists() )
+        {
             return;
+        }
 
-        try {
+        try
+        {
             nmavenRegistry.createRepositoryRegistry();
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-1501-004: Failed to create the repository registry for this plugin", e);
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-1501-004: Failed to create the repository registry for this plugin", e );
         }
 
         //resx.exe
         List<String> commands = new ArrayList<String>();
-        commands.add(sourceDirectory.getAbsolutePath());
-        commands.add(project.getBuild().getDirectory() + File.separator + "assembly-resources"
-                + File.separator + project.getArtifactId() + ".resx");
-        try {
+        commands.add( sourceDirectory.getAbsolutePath() );
+        commands.add( project.getBuild().getDirectory() + File.separator + "assembly-resources" + File.separator +
+            project.getArtifactId() + ".resx" );
+        try
+        {
             VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
-            if(vendor != null) vendorInfo.setVendor(VendorFactory.createVendorFromName(vendor));
-            vendorInfo.setFrameworkVersion(frameworkVersion);
-            vendorInfo.setVendorVersion(vendorVersion);
-            netExecutableFactory.getNetExecutableFromRepository("NMaven.Plugin", "NMaven.Plugin.Resx",
-                    vendorInfo, project, localRepository, commands).execute();
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("", e);
-        } catch(ExecutionException e) {
-            throw new MojoExecutionException("", e);
+            if ( vendor != null )
+            {
+                vendorInfo.setVendor( VendorFactory.createVendorFromName( vendor ) );
+            }
+            vendorInfo.setFrameworkVersion( frameworkVersion );
+            vendorInfo.setVendorVersion( vendorVersion );
+            netExecutableFactory.getNetExecutableFromRepository( "NMaven.Plugin", "NMaven.Plugin.Resx", vendorInfo,
+                                                                 project, localRepository, commands ).execute();
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "", e );
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "", e );
         }
 
         //resgen.exe
-        FileUtils.mkdir(project.getBuild().getDirectory() + File.separator + "assembly-resources" + File.separator
-                + "resource");
+        FileUtils.mkdir(
+            project.getBuild().getDirectory() + File.separator + "assembly-resources" + File.separator + "resource" );
 
-        try {
-            netExecutableFactory.getNetExecutableFor(vendor, frameworkVersion, "RESGEN",
-                    project, getCommands(), netHome).execute();
-        } catch (ExecutionException e) {
-            throw new MojoExecutionException("NMAVEN-1501-002: Unable to execute resgen: Vendor = " + vendor
-                    + ", frameworkVersion = " + frameworkVersion, e);
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("NMAVEN-1501-003: Platform Unsupported", e);
+        try
+        {
+            netExecutableFactory.getNetExecutableFor( vendor, frameworkVersion, "RESGEN", project, getCommands(),
+                                                      netHome ).execute();
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1501-002: Unable to execute resgen: Vendor = " + vendor +
+                ", frameworkVersion = " + frameworkVersion, e );
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1501-003: Platform Unsupported", e );
         }
     }
 
-    public List<String> getCommands() throws MojoExecutionException {
+    public List<String> getCommands()
+        throws MojoExecutionException
+    {
         List<String> commands = new ArrayList<String>();
-        commands.add(project.getBuild().getDirectory() + File.separator + "assembly-resources"
-                + File.separator + project.getArtifactId() + ".resx");
-        commands.add(project.getBuild().getDirectory() + File.separator + "assembly-resources" + File.separator
-                + "resource" + File.separator + project.getArtifactId() + ".resources");
+        commands.add( project.getBuild().getDirectory() + File.separator + "assembly-resources" + File.separator +
+            project.getArtifactId() + ".resx" );
+        commands.add( project.getBuild().getDirectory() + File.separator + "assembly-resources" + File.separator +
+            "resource" + File.separator + project.getArtifactId() + ".resources" );
         return commands;
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependency.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependency.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependency.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependency.java Tue Feb 27 09:45:32 2007
@@ -18,7 +18,8 @@
  */
 package org.apache.maven.dotnet.plugin.resolver;
 
-public class NetDependency {
+public class NetDependency
+{
 
     private String version;
 
@@ -28,58 +29,86 @@
 
     private String type;
 
-    public String getVersion() {
+    public String getVersion()
+    {
         return version;
     }
 
-    public void setVersion(String version) {
+    public void setVersion( String version )
+    {
         this.version = version;
     }
 
-    public String getArtifactId() {
+    public String getArtifactId()
+    {
         return artifactId;
     }
 
-    public void setArtifactId(String artifactId) {
+    public void setArtifactId( String artifactId )
+    {
         this.artifactId = artifactId;
     }
 
-    public String getGroupId() {
+    public String getGroupId()
+    {
         return groupId;
     }
 
-    public void setGroupId(String groupId) {
+    public void setGroupId( String groupId )
+    {
         this.groupId = groupId;
     }
 
-    public String getType() {
+    public String getType()
+    {
         return type;
     }
 
-    public void setType(String type) {
+    public void setType( String type )
+    {
         this.type = type;
     }
 
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
 
         final NetDependency that = (NetDependency) o;
 
-        if (!artifactId.equals(that.artifactId)) return false;
-        if (!groupId.equals(that.groupId)) return false;
-        if (type != null ? !type.equals(that.type) : that.type != null) return false;
-        if (!version.equals(that.version)) return false;
+        if ( !artifactId.equals( that.artifactId ) )
+        {
+            return false;
+        }
+        if ( !groupId.equals( that.groupId ) )
+        {
+            return false;
+        }
+        if ( type != null ? !type.equals( that.type ) : that.type != null )
+        {
+            return false;
+        }
+        if ( !version.equals( that.version ) )
+        {
+            return false;
+        }
 
         return true;
     }
 
-    public int hashCode() {
+    public int hashCode()
+    {
         int result;
         result = version.hashCode();
         result = 29 * result + artifactId.hashCode();
         result = 29 * result + groupId.hashCode();
-        result = 29 * result + (type != null ? type.hashCode() : 0);
+        result = 29 * result + ( type != null ? type.hashCode() : 0 );
         return result;
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java Tue Feb 27 09:45:32 2007
@@ -41,7 +41,9 @@
  * @goal resolve
  * @phase process-resources
  */
-public class NetDependencyResolverMojo extends AbstractMojo {
+public class NetDependencyResolverMojo
+    extends AbstractMojo
+{
     /**
      * The maven project.
      *
@@ -84,39 +86,58 @@
      */
     private org.apache.maven.dotnet.NMavenRepositoryRegistry nmavenRegistry;
 
-    public void execute() throws MojoExecutionException {
-        if(System.getProperty("bootstrap") != null)  return;
+    public void execute()
+        throws MojoExecutionException
+    {
+        if ( System.getProperty( "bootstrap" ) != null )
+        {
+            return;
+        }
 
         RepositoryRegistry repositoryRegistry;
-        try {
+        try
+        {
             repositoryRegistry = nmavenRegistry.createRepositoryRegistry();
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-1600-000: Failed to create the repository registry for this plugin", e);
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-1600-000: Failed to create the repository registry for this plugin", e );
         }
 
-        if (netDependencies == null) netDependencies = new NetDependency[0];
+        if ( netDependencies == null )
+        {
+            netDependencies = new NetDependency[0];
+        }
         List<Dependency> dependencies = new ArrayList<Dependency>();
-        for (NetDependency netDependency : netDependencies) {
+        for ( NetDependency netDependency : netDependencies )
+        {
             Dependency dependency = new Dependency();
-            dependency.setGroupId(netDependency.getGroupId());
-            dependency.setArtifactId(netDependency.getArtifactId());
-            dependency.setVersion(netDependency.getVersion());
-            dependency.setScope(Artifact.SCOPE_RUNTIME);
-            dependency.setType(netDependency.getType());
-            dependencies.add(dependency);
-        }
-
-        NetDependenciesRepository repository = (NetDependenciesRepository) repositoryRegistry.find("net-dependencies");
-        dependencies.addAll(repository.getDependencies());
-        getLog().info("NMAVEN-1600-001: Found net dependencies: Number = " + dependencies.size());
-
-        try {
-            assemblyResolver.resolveTransitivelyFor(project, project.getArtifact(), dependencies,
-                    pomFile, localRepository, false);
-        } catch (ArtifactResolutionException e) {
-            throw new MojoExecutionException("NMAVEN-1600-002: Unable to resolve assemblies", e);
-        } catch (ArtifactNotFoundException e) {
-            throw new MojoExecutionException("NMAVEN-1600-003: Unable to resolve assemblies", e);
+            dependency.setGroupId( netDependency.getGroupId() );
+            dependency.setArtifactId( netDependency.getArtifactId() );
+            dependency.setVersion( netDependency.getVersion() );
+            dependency.setScope( Artifact.SCOPE_RUNTIME );
+            dependency.setType( netDependency.getType() );
+            dependencies.add( dependency );
+        }
+
+        NetDependenciesRepository repository =
+            (NetDependenciesRepository) repositoryRegistry.find( "net-dependencies" );
+        dependencies.addAll( repository.getDependencies() );
+        getLog().info( "NMAVEN-1600-001: Found net dependencies: Number = " + dependencies.size() );
+
+        try
+        {
+            assemblyResolver.resolveTransitivelyFor( project, project.getArtifact(), dependencies, pomFile,
+                                                     localRepository, false );
+        }
+        catch ( ArtifactResolutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1600-002: Unable to resolve assemblies", e );
+        }
+        catch ( ArtifactNotFoundException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1600-003: Unable to resolve assemblies", e );
         }
 
     }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-settings-plugin/src/main/java/org/apache/maven/dotnet/plugin/settings/SettingsGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-settings-plugin/src/main/java/org/apache/maven/dotnet/plugin/settings/SettingsGeneratorMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-settings-plugin/src/main/java/org/apache/maven/dotnet/plugin/settings/SettingsGeneratorMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-settings-plugin/src/main/java/org/apache/maven/dotnet/plugin/settings/SettingsGeneratorMojo.java Tue Feb 27 09:45:32 2007
@@ -33,12 +33,13 @@
 import org.apache.maven.dotnet.vendor.VendorInfo;
 
 /**
- *
  * @author Shane Isbell
  * @goal generate-settings
  * @phase validate
  */
-public class SettingsGeneratorMojo extends AbstractMojo {
+public class SettingsGeneratorMojo
+    extends AbstractMojo
+{
 
     /**
      * @parameter expression="${settings.localRepository}"
@@ -54,7 +55,7 @@
      */
     private MavenProject project;
 
-   /**
+    /**
      * The Vendor for the executable. Supports MONO and MICROSOFT: the default value is <code>MICROSOFT</code>. Not
      * case or white-space sensitive.
      *
@@ -82,38 +83,59 @@
      */
     private org.apache.maven.dotnet.NMavenRepositoryRegistry nmavenRegistry;
 
-    public void execute() throws MojoExecutionException {
+    public void execute()
+        throws MojoExecutionException
+    {
 
-        if(!System.getProperty("os.name").contains("Windows")) return;
+        if ( !System.getProperty( "os.name" ).contains( "Windows" ) )
+        {
+            return;
+        }
 
-        if (System.getProperty("bootstrap") != null)
+        if ( System.getProperty( "bootstrap" ) != null )
+        {
             return;
+        }
 
-        String nmavenSettings = System.getProperty("user.home") + File.separator + ".m2" + File.separator
-                + "nmaven-settings.xml";
+        String nmavenSettings =
+            System.getProperty( "user.home" ) + File.separator + ".m2" + File.separator + "nmaven-settings.xml";
 
-        if (new File(nmavenSettings).exists())
+        if ( new File( nmavenSettings ).exists() )
+        {
             return;
+        }
 
-        try {
+        try
+        {
             nmavenRegistry.createRepositoryRegistry();
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-aaa-003: Failed to create the repository registry for this plugin", e);
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-aaa-003: Failed to create the repository registry for this plugin", e );
         }
 
         List<String> commands = new ArrayList<String>();
-        commands.add(new File(nmavenSettings).getAbsolutePath());
-        try {
+        commands.add( new File( nmavenSettings ).getAbsolutePath() );
+        try
+        {
             VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
-            if(vendor != null) vendorInfo.setVendor(VendorFactory.createVendorFromName(vendor));
-            vendorInfo.setFrameworkVersion(frameworkVersion);
-            vendorInfo.setVendorVersion(vendorVersion);
-            netExecutableFactory.getNetExecutableFromRepository("NMaven.Plugin", "NMaven.Plugin.Settings",
-                    vendorInfo, project, localRepository, commands).execute();
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("", e);
-        } catch(ExecutionException e) {
-            throw new MojoExecutionException("", e);
+            if ( vendor != null )
+            {
+                vendorInfo.setVendor( VendorFactory.createVendorFromName( vendor ) );
+            }
+            vendorInfo.setFrameworkVersion( frameworkVersion );
+            vendorInfo.setVendorVersion( vendorVersion );
+            netExecutableFactory.getNetExecutableFromRepository( "NMaven.Plugin", "NMaven.Plugin.Settings", vendorInfo,
+                                                                 project, localRepository, commands ).execute();
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "", e );
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "", e );
         }
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/test/TesterMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/test/TesterMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/test/TesterMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/test/TesterMojo.java Tue Feb 27 09:45:32 2007
@@ -42,7 +42,9 @@
  * @goal test
  * @phase test
  */
-public class TesterMojo extends AbstractMojo {
+public class TesterMojo
+    extends AbstractMojo
+{
 
     /**
      * The maven project.
@@ -90,94 +92,128 @@
     private String testAssemblyPath;
 
 
-    public String getExecutableFor(Vendor vendor, String home) {
-        return !(nunitHome == null || nunitHome.equals("")) ? nunitHome + File.separator + "bin"
-                + File.separator + "nunit-console" : "nunit-console";
+    public String getExecutableFor( Vendor vendor, String home )
+    {
+        return !( nunitHome == null || nunitHome.equals( "" ) ) ? nunitHome + File.separator + "bin" + File.separator +
+            "nunit-console" : "nunit-console";
     }
 
-    public List<String> getCommandsFor(Vendor vendor) throws MojoExecutionException {
+    public List<String> getCommandsFor( Vendor vendor )
+        throws MojoExecutionException
+    {
         String finalName = project.getBuild().getFinalName();
         List<String> commands = new ArrayList<String>();
-        commands.add(testAssemblyPath + File.separator + project.getArtifactId() + "-test.dll");
-        commands.add("/xml:" + reportsDirectory + File.separator + "TEST-" + finalName + ".xml");
+        commands.add( testAssemblyPath + File.separator + project.getArtifactId() + "-test.dll" );
+        commands.add( "/xml:" + reportsDirectory + File.separator + "TEST-" + finalName + ".xml" );
 
-        commands.add("/output:" + reportsDirectory + File.separator + "TEST-" + finalName + "-RESULTS.txt");
-        commands.add("/err:" + reportsDirectory + File.separator + "TEST-" + finalName + "-ERROR.txt");
-        commands.add("/labels");
-
-        if (xmlConsole) commands.add("/xmlConsole");
+        commands.add( "/output:" + reportsDirectory + File.separator + "TEST-" + finalName + "-RESULTS.txt" );
+        commands.add( "/err:" + reportsDirectory + File.separator + "TEST-" + finalName + "-ERROR.txt" );
+        commands.add( "/labels" );
+
+        if ( xmlConsole )
+        {
+            commands.add( "/xmlConsole" );
+        }
         return commands;
     }
 
-    public void execute() throws MojoExecutionException {
-        String skipTests = System.getProperty("maven.test.skip");
-        if ((skipTests != null && skipTests.equalsIgnoreCase("true")) || skipTest) {
-            getLog().warn("NMAVEN-1100-000: Unit tests have been disabled.");
+    public void execute()
+        throws MojoExecutionException
+    {
+        String skipTests = System.getProperty( "maven.test.skip" );
+        if ( ( skipTests != null && skipTests.equalsIgnoreCase( "true" ) ) || skipTest )
+        {
+            getLog().warn( "NMAVEN-1100-000: Unit tests have been disabled." );
             return;
         }
-        String testFileName = project.getBuild().getDirectory() + File.separator
-                + project.getArtifactId() + "-test.dll";
+        String testFileName =
+            project.getBuild().getDirectory() + File.separator + project.getArtifactId() + "-test.dll";
 
-        if (!(new File(testFileName).exists())) {
-            getLog().info("NMAVEN-1100-001: No Unit Tests");
+        if ( !( new File( testFileName ).exists() ) )
+        {
+            getLog().info( "NMAVEN-1100-001: No Unit Tests" );
             return;
         }
 
         List<Artifact> nunitLibs = new ArrayList<Artifact>();
         Set<Artifact> artifacts = project.getDependencyArtifacts();
-        for (Artifact artifact : artifacts) {
-            if (artifact.getGroupId().equals("org.nunit")) {
-                nunitLibs.add(artifact);
-            } else {
-                try {
-                    FileUtils.copyFileToDirectory(artifact.getFile(), new File(testAssemblyPath));
-                } catch (IOException e) {
-                    throw new MojoExecutionException("NMAVEN-1100-002", e);
+        for ( Artifact artifact : artifacts )
+        {
+            if ( artifact.getGroupId().equals( "org.nunit" ) )
+            {
+                nunitLibs.add( artifact );
+            }
+            else
+            {
+                try
+                {
+                    FileUtils.copyFileToDirectory( artifact.getFile(), new File( testAssemblyPath ) );
+                }
+                catch ( IOException e )
+                {
+                    throw new MojoExecutionException( "NMAVEN-1100-002", e );
                 }
             }
         }
 
-        if (nunitLibs.size() == 0)
-            throw new MojoExecutionException("NMAVEN-1100-003: Could not find any nunit libraries.");
+        if ( nunitLibs.size() == 0 )
+        {
+            throw new MojoExecutionException( "NMAVEN-1100-003: Could not find any nunit libraries." );
+        }
 
         //Copy Main Artifact
-        try {
-            if (project.getArtifact() != null && project.getArtifact().getFile() != null
-                    && project.getArtifact().getFile().exists()) {
-                FileUtils.copyFileToDirectory(project.getArtifact().getFile(), new File(testAssemblyPath));
+        try
+        {
+            if ( project.getArtifact() != null && project.getArtifact().getFile() != null &&
+                project.getArtifact().getFile().exists() )
+            {
+                FileUtils.copyFileToDirectory( project.getArtifact().getFile(), new File( testAssemblyPath ) );
             }
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-1100-004: Unable to copy library to target directory: ", e);
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1100-004: Unable to copy library to target directory: ", e );
         }
 
         //Copy Test Artifact
-        try {
-            FileUtils.copyFileToDirectory(new File(testFileName), new File(testAssemblyPath));
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-1100-005: Unable to copy library to target directory: ", e);
+        try
+        {
+            FileUtils.copyFileToDirectory( new File( testFileName ), new File( testAssemblyPath ) );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1100-005: Unable to copy library to target directory: ", e );
         }
 
         //Copy  NUnit Dependencies
-        for (Artifact artifact : nunitLibs) {
-            File file = new File(testAssemblyPath + File.separator + artifact.getArtifactId() + ".dll");
-            try {
-                FileUtils.copyFile(artifact.getFile(), file);
-            } catch (IOException e) {
-                throw new MojoExecutionException("NMAVEN-1100-006: Unable to copy nunit library to target directory: File = " +
-                        file.getAbsolutePath(), e);
+        for ( Artifact artifact : nunitLibs )
+        {
+            File file = new File( testAssemblyPath + File.separator + artifact.getArtifactId() + ".dll" );
+            try
+            {
+                FileUtils.copyFile( artifact.getFile(), file );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException(
+                    "NMAVEN-1100-006: Unable to copy nunit library to target directory: File = " +
+                        file.getAbsolutePath(), e );
             }
         }
 
-        FileUtils.mkdir(reportsDirectory);
+        FileUtils.mkdir( reportsDirectory );
 
-        List<String> commands = getCommandsFor(null);
-        getLog().debug("NMAVEN-1100-008: " + commands.toString());
+        List<String> commands = getCommandsFor( null );
+        getLog().debug( "NMAVEN-1100-008: " + commands.toString() );
         CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
         //commandExecutor.setLog(getLog());
-        try {
-            commandExecutor.executeCommand(getExecutableFor(null, null), commands);
-        } catch (ExecutionException e) {
-            throw new MojoExecutionException("NMAVEN-1100-007", e);
+        try
+        {
+            commandExecutor.executeCommand( getExecutableFor( null, null ), commands );
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1100-007", e );
         }
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetAchiverMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetAchiverMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetAchiverMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetAchiverMojo.java Tue Feb 27 09:45:32 2007
@@ -39,7 +39,9 @@
  * @goal package
  * @phase package
  */
-public class NetAchiverMojo extends AbstractMojo {
+public class NetAchiverMojo
+    extends AbstractMojo
+{
 
     /**
      * The maven project.
@@ -80,52 +82,69 @@
 
     private List excludes;
 
-    public void execute() throws MojoExecutionException {
+    public void execute()
+        throws MojoExecutionException
+    {
         String outputDirectory = project.getBuild().getDirectory() + File.separator + project.getArtifactId();
         String sourceDirectory = project.getBasedir() + "/src/main/webapp";
         DirectoryScanner directoryScanner = new DirectoryScanner();
-        directoryScanner.setBasedir(sourceDirectory);
+        directoryScanner.setBasedir( sourceDirectory );
         directoryScanner.addDefaultExcludes();
         directoryScanner.scan();
         String[] files = directoryScanner.getIncludedFiles();
-        for (String file : files) {
-            try {
-                FileUtils.copyFile(new File(sourceDirectory + File.separator + file),
-                        new File(outputDirectory + File.separator + file));
-            } catch (IOException e) {
-                throw new MojoExecutionException("NMAVEN-1200-000: Unable to process sources", e);
+        for ( String file : files )
+        {
+            try
+            {
+                FileUtils.copyFile( new File( sourceDirectory + File.separator + file ),
+                                    new File( outputDirectory + File.separator + file ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException( "NMAVEN-1200-000: Unable to process sources", e );
             }
         }
 
         Set<Artifact> artifacts = project.getDependencyArtifacts();
         Set<Artifact> dependencies = new HashSet<Artifact>();
-        dependencies.add(project.getArtifact());
-        for (Artifact artifact : artifacts) {
-            if ((artifact.getType().equals("library") || artifact.getType().equals("module")) &&
-                    artifact.getScope().equals(Artifact.SCOPE_COMPILE) || artifact.getScope().equals(Artifact.SCOPE_RUNTIME))
+        dependencies.add( project.getArtifact() );
+        for ( Artifact artifact : artifacts )
+        {
+            if ( ( artifact.getType().equals( "library" ) || artifact.getType().equals( "module" ) ) &&
+                artifact.getScope().equals( Artifact.SCOPE_COMPILE ) ||
+                artifact.getScope().equals( Artifact.SCOPE_RUNTIME ) )
             {
-                dependencies.add(artifact);
+                dependencies.add( artifact );
             }
         }
 
-        for (Artifact artifact : dependencies) {
-            try {
-                FileUtils.copyFileToDirectory(artifact.getFile(), new File(outputDirectory + "/bin"));
-            } catch (IOException e) {
-                throw new MojoExecutionException("NMAVEN-1200-001", e);
+        for ( Artifact artifact : dependencies )
+        {
+            try
+            {
+                FileUtils.copyFileToDirectory( artifact.getFile(), new File( outputDirectory + "/bin" ) );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException( "NMAVEN-1200-001", e );
             }
         }
 
         ZipArchiver zipArchiver = new ZipArchiver();
-        zipArchiver.setDestFile(new File(outputDirectory + ".nar"));
-        try {
-            zipArchiver.addDirectory(new File(outputDirectory));
+        zipArchiver.setDestFile( new File( outputDirectory + ".nar" ) );
+        try
+        {
+            zipArchiver.addDirectory( new File( outputDirectory ) );
             zipArchiver.createArchive();
-            getLog().info("NMAVEN-1200-004: Created .NET Archive: File = " + outputDirectory + ".nar");
-        } catch (ArchiverException e) {
-            throw new MojoExecutionException("NMAVEN-1200-002: Unable to create .NET archive:", e);
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-1200-003: Unable to create .NET archive", e);
+            getLog().info( "NMAVEN-1200-004: Created .NET Archive: File = " + outputDirectory + ".nar" );
+        }
+        catch ( ArchiverException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1200-002: Unable to create .NET archive:", e );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1200-003: Unable to create .NET archive", e );
         }
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetArchiveDeployerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetArchiveDeployerMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetArchiveDeployerMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-webapp-plugin/src/main/java/org/apache/maven/dotnet/plugin/webapp/NetArchiveDeployerMojo.java Tue Feb 27 09:45:32 2007
@@ -34,7 +34,9 @@
  * @goal deploy
  * @phase deploy
  */
-public class NetArchiveDeployerMojo extends AbstractMojo {
+public class NetArchiveDeployerMojo
+    extends AbstractMojo
+{
 
     /**
      * The maven project.
@@ -53,17 +55,22 @@
      */
     private String deployPath;
 
-    public void execute() throws MojoExecutionException {
+    public void execute()
+        throws MojoExecutionException
+    {
         String outputDirectory = project.getBuild().getDirectory() + File.separator + project.getArtifactId();
         String deployArtifact = deployPath + File.separator + project.getArtifactId();
-        try {
-            FileUtils.copyDirectoryStructure(new File(outputDirectory),
-                    new File(deployArtifact));
-            getLog().info("NMAVEN-1201-001: Copied .NET Web Application to deployment directory: " +
-                    "From = " + outputDirectory + ", To = " + deployArtifact);
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-1201-000: Failed to copy .NET Web Application to deployment directory: " +
-                    "From = " + outputDirectory + ", To = " + deployArtifact, e);
+        try
+        {
+            FileUtils.copyDirectoryStructure( new File( outputDirectory ), new File( deployArtifact ) );
+            getLog().info( "NMAVEN-1201-001: Copied .NET Web Application to deployment directory: " + "From = " +
+                outputDirectory + ", To = " + deployArtifact );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-1201-000: Failed to copy .NET Web Application to deployment directory: " + "From = " +
+                    outputDirectory + ", To = " + deployArtifact, e );
         }
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/PlatformDetector.java Tue Feb 27 09:45:32 2007
@@ -33,27 +33,28 @@
  *
  * @author Shane Isbell
  */
-public interface PlatformDetector {
+public interface PlatformDetector
+{
     /**
      * Sets the results that are included in the standard output for Microsoft.
      *
      * @param microsoftContainsString
      */
-    void setMicrosoftContainsString(String microsoftContainsString);
+    void setMicrosoftContainsString( String microsoftContainsString );
 
     /**
      * Sets the results that are included in the standard output for Mono.
      *
      * @param monoContainsString
      */
-    void setMonoContainsString(String monoContainsString);
+    void setMonoContainsString( String monoContainsString );
 
     /**
      * Sets the results that are included in the standard output for DotGnu.
      *
      * @param gnuContainsString
      */
-    void setGnuContainsString(String gnuContainsString);
+    void setGnuContainsString( String gnuContainsString );
 
     /**
      * Returns a Vendor instance for the given command and/or netHomePath. If the command is specified, you may need to
@@ -63,16 +64,22 @@
      * @param command
      * @param netHomePath
      * @return a Vendor instance for the given command and/or netHomePath
-     * @throws org.apache.maven.dotnet.PlatformUnsupportedException if the vendor cannot be matched
+     * @throws org.apache.maven.dotnet.PlatformUnsupportedException
+     *          if the vendor cannot be matched
      */
-    Vendor getVendorFor(String command, File netHomePath) throws PlatformUnsupportedException;
+    Vendor getVendorFor( String command, File netHomePath )
+        throws PlatformUnsupportedException;
 
-    public static class Factory {
-        private Factory() {
+    public static class Factory
+    {
+        private Factory()
+        {
         }
 
-        public static PlatformDetector createDefaultPlatformDetector() {
-            return new PlatformDetector() {
+        public static PlatformDetector createDefaultPlatformDetector()
+        {
+            return new PlatformDetector()
+            {
 
                 /**
                  * String to be matched to standard output for Microsoft
@@ -89,38 +96,56 @@
                  */
                 private String gnuContainsString = "Southern Storm";
 
-                public void setMicrosoftContainsString(String microsoftContainsString) {
+                public void setMicrosoftContainsString( String microsoftContainsString )
+                {
                     this.microsoftContainsString = microsoftContainsString;
                 }
 
-                public void setMonoContainsString(String monoContainsString) {
+                public void setMonoContainsString( String monoContainsString )
+                {
                     this.monoContainsString = monoContainsString;
                 }
 
-                public void setGnuContainsString(String gnuContainsString) {
+                public void setGnuContainsString( String gnuContainsString )
+                {
                     this.gnuContainsString = gnuContainsString;
                 }
 
-                public Vendor getVendorFor(String command, File netHomePath) throws PlatformUnsupportedException {
-                    String netHome = (netHomePath == null) ? null : netHomePath.getAbsolutePath();
-                    if (isEmpty(command) && isEmpty(netHome)) {
-                        throw new PlatformUnsupportedException("NMAVEN-042-000: Both command and netHome params cannot be null or empty");
-                    } else if (!isEmpty(command) && isEmpty(netHome)) {
-                        return getVendorForCommand(command);
-                    } else if (isEmpty(command) && !isEmpty(netHome)) {
-                        return getVendorFromPath(netHome);
-                    } else if (!isEmpty(command) && !isEmpty(netHome)) {
-                        try {
-                            return getVendorFromPath(netHome);
-                        } catch (PlatformUnsupportedException e) {
+                public Vendor getVendorFor( String command, File netHomePath )
+                    throws PlatformUnsupportedException
+                {
+                    String netHome = ( netHomePath == null ) ? null : netHomePath.getAbsolutePath();
+                    if ( isEmpty( command ) && isEmpty( netHome ) )
+                    {
+                        throw new PlatformUnsupportedException(
+                            "NMAVEN-042-000: Both command and netHome params cannot be null or empty" );
+                    }
+                    else if ( !isEmpty( command ) && isEmpty( netHome ) )
+                    {
+                        return getVendorForCommand( command );
+                    }
+                    else if ( isEmpty( command ) && !isEmpty( netHome ) )
+                    {
+                        return getVendorFromPath( netHome );
+                    }
+                    else if ( !isEmpty( command ) && !isEmpty( netHome ) )
+                    {
+                        try
+                        {
+                            return getVendorFromPath( netHome );
+                        }
+                        catch ( PlatformUnsupportedException e )
+                        {
 
                             //log.debug(e);
                         }
-                        try {
-                            return getVendorForCommand(netHome + File.separator
-                                    + "bin" + File.separator + command);
-                        } catch (PlatformUnsupportedException e) {
-                            throw new PlatformUnsupportedException("");
+                        try
+                        {
+                            return getVendorForCommand( netHome + File.separator + "bin" + File.separator + command );
+                        }
+                        catch ( PlatformUnsupportedException e )
+                        {
+                            throw new PlatformUnsupportedException( "" );
                         }
                     }
                     return null;
@@ -131,28 +156,40 @@
                  *
                  * @param command
                  * @return vendor instance
-                 * @throws org.apache.maven.dotnet.PlatformUnsupportedException if the platform cannot be matched.
+                 * @throws org.apache.maven.dotnet.PlatformUnsupportedException
+                 *          if the platform cannot be matched.
                  */
-                private Vendor getVendorForCommand(String command) throws PlatformUnsupportedException {
+                private Vendor getVendorForCommand( String command )
+                    throws PlatformUnsupportedException
+                {
                     CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
                     //commandExecutor.setLogger(logger);
-                    try {
+                    try
+                    {
                         List<String> commands = new ArrayList<String>();
-                        commandExecutor.executeCommand(command, commands);
-                    } catch (ExecutionException e) {
-                        throw new PlatformUnsupportedException("", e);
+                        commandExecutor.executeCommand( command, commands );
+                    }
+                    catch ( ExecutionException e )
+                    {
+                        throw new PlatformUnsupportedException( "", e );
                     }
                     String results = commandExecutor.getStandardOut();
-                    if (results.contains(microsoftContainsString)) {
+                    if ( results.contains( microsoftContainsString ) )
+                    {
                         return Vendor.MICROSOFT;
-                    } else if (results.contains(monoContainsString)) {
+                    }
+                    else if ( results.contains( monoContainsString ) )
+                    {
                         return Vendor.MONO;
-                    } else if (results.contains(gnuContainsString) || results.contains("cscc"))
+                    }
+                    else if ( results.contains( gnuContainsString ) || results.contains( "cscc" ) )
                     {//cscc does not contain vendor name
                         return Vendor.DOTGNU;
-                    } else {
-                        throw new PlatformUnsupportedException("NMAVEN-042-001: Platform not supported: Results = "
-                                + results);
+                    }
+                    else
+                    {
+                        throw new PlatformUnsupportedException(
+                            "NMAVEN-042-001: Platform not supported: Results = " + results );
                     }
                 }
 
@@ -163,23 +200,33 @@
                  * @return vendor
                  * @throws PlatformUnsupportedException
                  */
-                private Vendor getVendorFromPath(String path) throws PlatformUnsupportedException {
-                    if (!new File(path).exists()) {
-                        throw new PlatformUnsupportedException("NMAVEN-042-002: Unable to locate path: Path = " + path);
+                private Vendor getVendorFromPath( String path )
+                    throws PlatformUnsupportedException
+                {
+                    if ( !new File( path ).exists() )
+                    {
+                        throw new PlatformUnsupportedException(
+                            "NMAVEN-042-002: Unable to locate path: Path = " + path );
                     }
 
-                    if (path.contains("Microsoft.NET")) {
+                    if ( path.contains( "Microsoft.NET" ) )
+                    {
                         return Vendor.MICROSOFT;
-                    } else if (path.contains("Mono")) {
+                    }
+                    else if ( path.contains( "Mono" ) )
+                    {
                         return Vendor.MONO;
-                    } else if (path.contains("Portable.NET")) {
+                    }
+                    else if ( path.contains( "Portable.NET" ) )
+                    {
                         return Vendor.DOTGNU;
                     }
-                    throw new PlatformUnsupportedException("NMAVEN-042-003: Platform not supported: Path " + path);
+                    throw new PlatformUnsupportedException( "NMAVEN-042-003: Platform not supported: Path " + path );
                 }
 
-                private boolean isEmpty(String value) {
-                    return (value == null || value.trim().equals(""));
+                private boolean isEmpty( String value )
+                {
+                    return ( value == null || value.trim().equals( "" ) );
                 }
             };
         }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Proxy.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Proxy.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Proxy.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Proxy.java Tue Feb 27 09:45:32 2007
@@ -23,7 +23,8 @@
  *
  * @author Shane Isbell
  */
-public class Proxy {
+public class Proxy
+{
 
     private String id;
 
@@ -31,42 +32,59 @@
 
     private String hashAlg;
 
-    public String getId() {
+    public String getId()
+    {
         return id;
     }
 
-    public void setId(String id) {
+    public void setId( String id )
+    {
         this.id = id;
     }
 
-    public boolean isHashPassword() {
+    public boolean isHashPassword()
+    {
         return hashPassword;
     }
 
-    public void setHashPassword(boolean hashPassword) {
+    public void setHashPassword( boolean hashPassword )
+    {
         this.hashPassword = hashPassword;
     }
 
-    public String getHashAlg() {
+    public String getHashAlg()
+    {
         return hashAlg;
     }
 
-    public void setHashAlg(String hashAlg) {
+    public void setHashAlg( String hashAlg )
+    {
         this.hashAlg = hashAlg;
     }
 
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
 
         final Proxy proxy = (Proxy) o;
 
-        if (!id.equals(proxy.id)) return false;
+        if ( !id.equals( proxy.id ) )
+        {
+            return false;
+        }
 
         return true;
     }
 
-    public int hashCode() {
+    public int hashCode()
+    {
         return id.hashCode();
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Server.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Server.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Server.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/Server.java Tue Feb 27 09:45:32 2007
@@ -23,7 +23,8 @@
  *
  * @author Shane Isbell
  */
-public class Server {
+public class Server
+{
 
     private String id;
 
@@ -31,46 +32,64 @@
 
     private String hashAlg;
 
-    public String getId() {
+    public String getId()
+    {
         return id;
     }
 
-    public void setId(String id) {
+    public void setId( String id )
+    {
         this.id = id;
     }
 
-    public boolean isHashPassword() {
+    public boolean isHashPassword()
+    {
         return hashPassword;
     }
 
-    public void setHashPassword(boolean hashPassword) {
+    public void setHashPassword( boolean hashPassword )
+    {
         this.hashPassword = hashPassword;
     }
 
-    public String getHashAlg() {
+    public String getHashAlg()
+    {
         return hashAlg;
     }
 
-    public void setHashAlg(String hashAlg) {
+    public void setHashAlg( String hashAlg )
+    {
         this.hashAlg = hashAlg;
     }
 
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
 
         final Server server = (Server) o;
 
-        if (!id.equals(server.id)) return false;
+        if ( !id.equals( server.id ) )
+        {
+            return false;
+        }
 
         return true;
     }
 
-    public int hashCode() {
+    public int hashCode()
+    {
         return id.hashCode();
     }
 
-    public String toString() {
+    public String toString()
+    {
         return "id = " + id;
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-wsdl-plugin/src/main/java/org/apache/maven/dotnet/plugin/wsdl/WsdlGeneratorMojo.java Tue Feb 27 09:45:32 2007
@@ -43,7 +43,9 @@
  * @goal wsdl
  * @phase process-sources
  */
-public class WsdlGeneratorMojo extends AbstractMojo {
+public class WsdlGeneratorMojo
+    extends AbstractMojo
+{
 
     /**
      * The directory to place the generated binding classes.
@@ -166,114 +168,180 @@
      */
     private boolean ignoreUnusedOptions;
 
-    public void execute() throws MojoExecutionException {
+    public void execute()
+        throws MojoExecutionException
+    {
         Vendor vendor = getCompilerVendor();
-        List<String> commands = getCommandsFor(vendor);
+        List<String> commands = getCommandsFor( vendor );
 
-        getLog().debug("NMAVEN-1300-000: Commands = " + commands.toString());
+        getLog().debug( "NMAVEN-1300-000: Commands = " + commands.toString() );
         CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
         //commandExecutor.setLog(getLog());
-        try {
-            commandExecutor.executeCommand(getExecutableFor(vendor, netHome), commands);
-            for (String path : paths) {
-                getLog().info("NMAVEN-1300-008: Generated WSDL: File = " + outputDirectory + File.separator +
-                        getFileNameFor(path));
+        try
+        {
+            commandExecutor.executeCommand( getExecutableFor( vendor, netHome ), commands );
+            for ( String path : paths )
+            {
+                getLog().info( "NMAVEN-1300-008: Generated WSDL: File = " + outputDirectory + File.separator +
+                    getFileNameFor( path ) );
             }
 
-        } catch (ExecutionException e) {
+        }
+        catch ( ExecutionException e )
+        {
             //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.
             //I don't want to fail on MONO warning here.
-            if ((vendor.equals(Vendor.MONO) && commandExecutor.getResult() > 1)
-                    || vendor.equals(Vendor.MICROSOFT))
-                throw new MojoExecutionException("NMAVEN-1300-001: Result = " + commandExecutor.getResult(), e);
+            if ( ( vendor.equals( Vendor.MONO ) && commandExecutor.getResult() > 1 ) ||
+                vendor.equals( Vendor.MICROSOFT ) )
+            {
+                throw new MojoExecutionException( "NMAVEN-1300-001: Result = " + commandExecutor.getResult(), e );
+            }
         }
     }
 
-    public String getExecutableFor(Vendor vendor, String home) {
-        String executable = (vendor.equals(Vendor.MICROSOFT)) ? "wsdl" : "wsdl2";
-        return (!isEmpty(home)) ? home + File.separator + "bin" + File.separator + executable : executable;
+    public String getExecutableFor( Vendor vendor, String home )
+    {
+        String executable = ( vendor.equals( Vendor.MICROSOFT ) ) ? "wsdl" : "wsdl2";
+        return ( !isEmpty( home ) ) ? home + File.separator + "bin" + File.separator + executable : executable;
     }
 
-    public List<String> getCommandsFor(Vendor vendor) throws MojoExecutionException {
-        String commandFlag = vendor.equals(Vendor.MICROSOFT) ? "/" : "-";
+    public List<String> getCommandsFor( Vendor vendor )
+        throws MojoExecutionException
+    {
+        String commandFlag = vendor.equals( Vendor.MICROSOFT ) ? "/" : "-";
 
         List<String> commands = new ArrayList<String>();
-        populateServerCommands(commands, commandFlag);
-        populateProxyCommands(commands, commandFlag);
-        commands.add(commandFlag + "language:" + language);
-        commands.add(commandFlag + "namespace:" + namespace);
-        commands.add(commandFlag + "fields:" + fields);
-        if (!isEmpty(protocol)) commands.add(commandFlag + "protocol:" + protocol);
-
-        for (String path : paths) {
-            commands.add(commandFlag + "out:" + outputDirectory + File.separator +
-                    getFileNameFor(path));
-        }
-
-        for (String path : paths) {
-            commands.add(new File(path).getAbsolutePath());
-        }
-
-        if (vendor.equals(Vendor.MONO)) {
-            if (serverInterface) commands.add("-server");
-            if ((fields || enableDataBinding || order || sharetypes || verbose)) {
-                if (!ignoreUnusedOptions)
-                    throw new MojoExecutionException("NMAVEN-1300-005: Illegal Option(s) for Mono");
+        populateServerCommands( commands, commandFlag );
+        populateProxyCommands( commands, commandFlag );
+        commands.add( commandFlag + "language:" + language );
+        commands.add( commandFlag + "namespace:" + namespace );
+        commands.add( commandFlag + "fields:" + fields );
+        if ( !isEmpty( protocol ) )
+        {
+            commands.add( commandFlag + "protocol:" + protocol );
+        }
+
+        for ( String path : paths )
+        {
+            commands.add( commandFlag + "out:" + outputDirectory + File.separator + getFileNameFor( path ) );
+        }
+
+        for ( String path : paths )
+        {
+            commands.add( new File( path ).getAbsolutePath() );
+        }
+
+        if ( vendor.equals( Vendor.MONO ) )
+        {
+            if ( serverInterface )
+            {
+                commands.add( "-server" );
+            }
+            if ( ( fields || enableDataBinding || order || sharetypes || verbose ) )
+            {
+                if ( !ignoreUnusedOptions )
+                {
+                    throw new MojoExecutionException( "NMAVEN-1300-005: Illegal Option(s) for Mono" );
+                }
                 else
-                    getLog().warn("NMAVEN-1300-002: Your pom.xml contains an option that is not supported by MONO: Your application" +
-                            " artifact will differ dependening on compiler/platform and may have different behavior.");
+                {
+                    getLog().warn(
+                        "NMAVEN-1300-002: Your pom.xml contains an option that is not supported by MONO: Your application" +
+                            " artifact will differ dependening on compiler/platform and may have different behavior." );
+                }
+            }
+        }
+        else
+        {
+            if ( serverInterface )
+            {
+                commands.add( "/server" );
+            }
+            if ( enableDataBinding )
+            {
+                commands.add( "/enableDataBinding" );
+            }
+            if ( sharetypes )
+            {
+                commands.add( "/sharetypes" );
+            }
+            if ( verbose )
+            {
+                commands.add( "/verbose" );
+            }
+            if ( order )
+            {
+                commands.add( "/order" );
             }
-        } else {
-            if (serverInterface) commands.add("/server");
-            if (enableDataBinding) commands.add("/enableDataBinding");
-            if (sharetypes) commands.add("/sharetypes");
-            if (verbose) commands.add("/verbose");
-            if (order) commands.add("/order");
         }
         return commands;
     }
 
-    private boolean isURL(String path) {
-        try {
-            new URL(path);
-        } catch (MalformedURLException e) {
+    private boolean isURL( String path )
+    {
+        try
+        {
+            new URL( path );
+        }
+        catch ( MalformedURLException e )
+        {
             return false;
         }
         return true;
     }
 
-    private String getFileNameFor(String path) {
+    private String getFileNameFor( String path )
+    {
         String wsdlName;
-        if (isURL(path)) {
-            wsdlName = path.substring(path.lastIndexOf("/"), path.length());
-        } else {
-            if (path.contains("/")) {
-                wsdlName = path.substring(path.lastIndexOf("/"), path.length());
-            } else if (path.contains("\\")) {
-                wsdlName = path.substring(path.lastIndexOf("\\"), path.length());
-            } else {
+        if ( isURL( path ) )
+        {
+            wsdlName = path.substring( path.lastIndexOf( "/" ), path.length() );
+        }
+        else
+        {
+            if ( path.contains( "/" ) )
+            {
+                wsdlName = path.substring( path.lastIndexOf( "/" ), path.length() );
+            }
+            else if ( path.contains( "\\" ) )
+            {
+                wsdlName = path.substring( path.lastIndexOf( "\\" ), path.length() );
+            }
+            else
+            {
                 wsdlName = path;
             }
         }
-        return wsdlName.substring(0, wsdlName.lastIndexOf(".")) + "." + language.toLowerCase();
+        return wsdlName.substring( 0, wsdlName.lastIndexOf( "." ) ) + "." + language.toLowerCase();
     }
 
-    private void populateProxyCommands(List<String> commands, String commandFlag) throws MojoExecutionException {
-        if (proxy != null) {
-            Proxy mProxy = getProxyFor(proxy.getId());
-            if (mProxy != null) {
-                getLog().debug("NMAVEN-1300-003: Found proxy: ID = " + mProxy.getId());
+    private void populateProxyCommands( List<String> commands, String commandFlag )
+        throws MojoExecutionException
+    {
+        if ( proxy != null )
+        {
+            Proxy mProxy = getProxyFor( proxy.getId() );
+            if ( mProxy != null )
+            {
+                getLog().debug( "NMAVEN-1300-003: Found proxy: ID = " + mProxy.getId() );
                 String username = mProxy.getUsername();
                 String password = mProxy.getPassword();
                 boolean isHashed = proxy.isHashPassword();
-                if (!isEmpty(password) && isHashed) {
+                if ( !isEmpty( password ) && isHashed )
+                {
                     String alg = proxy.getHashAlg();
-                    if (isEmpty(alg)) alg = "SHA1";
-                    try {
-                        password = new String(MessageDigest.getInstance(alg).digest(password.getBytes()));
-                    } catch (NoSuchAlgorithmException e) {
-                        throw new MojoExecutionException("NMAVEN-1300-004: No Such Algorithm for hashing the password: " +
-                                "Algorithm = " + alg, e);
+                    if ( isEmpty( alg ) )
+                    {
+                        alg = "SHA1";
+                    }
+                    try
+                    {
+                        password = new String( MessageDigest.getInstance( alg ).digest( password.getBytes() ) );
+                    }
+                    catch ( NoSuchAlgorithmException e )
+                    {
+                        throw new MojoExecutionException(
+                            "NMAVEN-1300-004: No Such Algorithm for hashing the password: " + "Algorithm = " + alg, e );
                     }
                 }
                 String proxyHost = mProxy.getHost();
@@ -281,81 +349,139 @@
                 String proxyProtocol = mProxy.getProtocol();
 
                 StringBuffer proxyUrl = new StringBuffer();
-                if (!isEmpty(proxyProtocol)) proxyUrl.append(proxyProtocol).append("://");
-                if (!isEmpty(proxyHost)) proxyUrl.append(proxyHost);
-                if (proxyPort > 0) proxyUrl.append(":").append(proxyPort);
-                if (proxyUrl.length() != 0) commands.add(commandFlag + "proxy:" + proxyUrl.toString());
-                if (!isEmpty(username)) commands.add(commandFlag + "proxyusername:" + username);
-                if (!isEmpty(password)) commands.add(commandFlag + "proxypassword:" + password);
+                if ( !isEmpty( proxyProtocol ) )
+                {
+                    proxyUrl.append( proxyProtocol ).append( "://" );
+                }
+                if ( !isEmpty( proxyHost ) )
+                {
+                    proxyUrl.append( proxyHost );
+                }
+                if ( proxyPort > 0 )
+                {
+                    proxyUrl.append( ":" ).append( proxyPort );
+                }
+                if ( proxyUrl.length() != 0 )
+                {
+                    commands.add( commandFlag + "proxy:" + proxyUrl.toString() );
+                }
+                if ( !isEmpty( username ) )
+                {
+                    commands.add( commandFlag + "proxyusername:" + username );
+                }
+                if ( !isEmpty( password ) )
+                {
+                    commands.add( commandFlag + "proxypassword:" + password );
+                }
             }
         }
     }
 
-    private void populateServerCommands(List<String> commands, String commandFlag) throws MojoExecutionException {
-        if (server != null) {
-            Server mServer = getServerFor(server.getId());
-            if (mServer != null) {
+    private void populateServerCommands( List<String> commands, String commandFlag )
+        throws MojoExecutionException
+    {
+        if ( server != null )
+        {
+            Server mServer = getServerFor( server.getId() );
+            if ( mServer != null )
+            {
                 String username = mServer.getUsername();
                 String password = mServer.getPassword();
                 boolean isHashed = server.isHashPassword();
-                if (!isEmpty(password) && isHashed) {
+                if ( !isEmpty( password ) && isHashed )
+                {
                     String alg = server.getHashAlg();
-                    if (isEmpty(alg)) alg = "SHA1";
-                    try {
-                        password = new String(MessageDigest.getInstance(alg).digest(password.getBytes()));
-                    } catch (NoSuchAlgorithmException e) {
-                        throw new MojoExecutionException("NMAVEN-1300-005: No Such Algorithm for hashing the password: " +
-                                "Algorithm = " + alg, e);
+                    if ( isEmpty( alg ) )
+                    {
+                        alg = "SHA1";
+                    }
+                    try
+                    {
+                        password = new String( MessageDigest.getInstance( alg ).digest( password.getBytes() ) );
                     }
+                    catch ( NoSuchAlgorithmException e )
+                    {
+                        throw new MojoExecutionException(
+                            "NMAVEN-1300-005: No Such Algorithm for hashing the password: " + "Algorithm = " + alg, e );
+                    }
+                }
+                if ( !isEmpty( username ) )
+                {
+                    commands.add( commandFlag + "username:" + username );
+                }
+                if ( !isEmpty( password ) )
+                {
+                    commands.add( commandFlag + "password:" + password );
                 }
-                if (!isEmpty(username)) commands.add(commandFlag + "username:" + username);
-                if (!isEmpty(password)) commands.add(commandFlag + "password:" + password);
             }
         }
     }
 
-    private Vendor getCompilerVendor() throws MojoExecutionException {
+    private Vendor getCompilerVendor()
+        throws MojoExecutionException
+    {
         Vendor vendor;
         PlatformDetector platformDetector = PlatformDetector.Factory.createDefaultPlatformDetector();
-        if (isEmpty(netHome)) {
-            try {
-                vendor = platformDetector.getVendorFor("wsdl", null);
-            } catch (PlatformUnsupportedException e) {
-                throw new MojoExecutionException("NMAVEN-1300-009", e);
-            }
-        } else {
-            File file = new File(netHome);
-            if (!file.exists()) {
-                throw new MojoExecutionException("NMAVEN-1300-006: Unable to locate netHome - make sure that it exists:" +
-                        " Home = " + netHome);
-            }
-            try {
-                vendor = platformDetector.getVendorFor(null, new File(file.getAbsolutePath() + File.separator
-                        + "bin" + File.separator + "wsdl"));
-            } catch (PlatformUnsupportedException e) {
-                throw new MojoExecutionException("NMAVEN-1300-010", e);
+        if ( isEmpty( netHome ) )
+        {
+            try
+            {
+                vendor = platformDetector.getVendorFor( "wsdl", null );
+            }
+            catch ( PlatformUnsupportedException e )
+            {
+                throw new MojoExecutionException( "NMAVEN-1300-009", e );
+            }
+        }
+        else
+        {
+            File file = new File( netHome );
+            if ( !file.exists() )
+            {
+                throw new MojoExecutionException(
+                    "NMAVEN-1300-006: Unable to locate netHome - make sure that it exists:" + " Home = " + netHome );
+            }
+            try
+            {
+                vendor = platformDetector.getVendorFor( null, new File(
+                    file.getAbsolutePath() + File.separator + "bin" + File.separator + "wsdl" ) );
+            }
+            catch ( PlatformUnsupportedException e )
+            {
+                throw new MojoExecutionException( "NMAVEN-1300-010", e );
             }
 
         }
-        getLog().info("NMAVEN-1300-007: WSDL Vendor found: " + vendor.getVendorName());
+        getLog().info( "NMAVEN-1300-007: WSDL Vendor found: " + vendor.getVendorName() );
         return vendor;
     }
 
-    private Proxy getProxyFor(String id) {
-        for (Proxy proxy : proxies) {
-            if (proxy.getId().trim().equals(id.trim())) return proxy;
+    private Proxy getProxyFor( String id )
+    {
+        for ( Proxy proxy : proxies )
+        {
+            if ( proxy.getId().trim().equals( id.trim() ) )
+            {
+                return proxy;
+            }
         }
         return null;
     }
 
-    private Server getServerFor(String id) {
-        for (Server server : servers) {
-            if (server.getId().trim().equals(id.trim())) return server;
+    private Server getServerFor( String id )
+    {
+        for ( Server server : servers )
+        {
+            if ( server.getId().trim().equals( id.trim() ) )
+            {
+                return server;
+            }
         }
         return null;
     }
 
-    private boolean isEmpty(String value) {
-        return (value == null || value.trim().equals(""));
+    private boolean isEmpty( String value )
+    {
+        return ( value == null || value.trim().equals( "" ) );
     }
 }

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XmlToXsdGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XmlToXsdGeneratorMojo.java?view=diff&rev=512336&r1=512335&r2=512336
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XmlToXsdGeneratorMojo.java (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XmlToXsdGeneratorMojo.java Tue Feb 27 09:45:32 2007
@@ -38,7 +38,9 @@
  * @goal xml
  * @phase process-sources
  */
-public class XmlToXsdGeneratorMojo extends AbstractMojo {
+public class XmlToXsdGeneratorMojo
+    extends AbstractMojo
+{
 
     /**
      * The directory to place the generated binding classes.
@@ -99,34 +101,50 @@
      */
     private org.apache.maven.dotnet.NMavenRepositoryRegistry nmavenRegistry;
 
-    public void execute() throws MojoExecutionException {
-        try {
+    public void execute()
+        throws MojoExecutionException
+    {
+        try
+        {
             nmavenRegistry.createRepositoryRegistry();
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-1401-003: Failed to create the repository registry for this plugin", e);
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-1401-003: Failed to create the repository registry for this plugin", e );
         }
 
-        FileUtils.mkdir(outputDirectory);
-        try {
-            netExecutableFactory.getNetExecutableFor(vendor, frameworkVersion, profile,
-                    project, getCommands(), netHome).execute();
-        } catch (ExecutionException e) {
-            throw new MojoExecutionException("NMAVEN-1401-000: Unable to execute xsd: Vendor " + vendor
-                    + ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile,  e);
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("NMAVEN-1401-001: Platform Unsupported: Vendor " + vendor
-                    + ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile, e);
+        FileUtils.mkdir( outputDirectory );
+        try
+        {
+            netExecutableFactory.getNetExecutableFor( vendor, frameworkVersion, profile, project, getCommands(),
+                                                      netHome ).execute();
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1401-000: Unable to execute xsd: Vendor " + vendor +
+                ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile, e );
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-1401-001: Platform Unsupported: Vendor " + vendor +
+                ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile, e );
         }
     }
 
-    public List<String> getCommands() throws MojoExecutionException {
+    public List<String> getCommands()
+        throws MojoExecutionException
+    {
         List<String> commands = new ArrayList<String>();
-        for (String xmlFile : xmlFiles) {
-            if (!(new File(xmlFile)).exists())
-                throw new MojoExecutionException("NMAVEN-1401-002: XML File does not exist: FileName = " + xmlFile);
-            commands.add(xmlFile);
+        for ( String xmlFile : xmlFiles )
+        {
+            if ( !( new File( xmlFile ) ).exists() )
+            {
+                throw new MojoExecutionException( "NMAVEN-1401-002: XML File does not exist: FileName = " + xmlFile );
+            }
+            commands.add( xmlFile );
         }
-        commands.add("/o:" + outputDirectory);
+        commands.add( "/o:" + outputDirectory );
         return commands;
     }
 }



Mime
View raw message