Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XsdGeneratorMojo.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/XsdGeneratorMojo.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/XsdGeneratorMojo.java (original) +++ incubator/nmaven/branches/SI_IDE/plugins/maven-xsd-plugin/src/main/java/org/apache/maven/dotnet/plugin/xsd/XsdGeneratorMojo.java Tue Feb 27 09:45:32 2007 @@ -39,7 +39,9 @@ * @phase process-sources */ -public class XsdGeneratorMojo extends AbstractMojo { +public class XsdGeneratorMojo + extends AbstractMojo +{ /** @@ -163,47 +165,75 @@ */ 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-1400-0032 Failed to create the repository registry for this plugin", e); + } + catch ( IOException e ) + { + throw new MojoExecutionException( + "NMAVEN-1400-0032 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-1400-000: Unable to execute xsd: Vendor " + vendor - + ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile, e); - } catch (PlatformUnsupportedException e) { - throw new MojoExecutionException("NMAVEN-1400-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-1400-000: Unable to execute xsd: Vendor " + vendor + + ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile, e ); + } + catch ( PlatformUnsupportedException e ) + { + throw new MojoExecutionException( "NMAVEN-1400-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>(); - commands.add(new File(xsdFile.trim()).getAbsolutePath()); - commands.add("/o:" + outputDirectory); - commands.add("/" + generate.trim()); - commands.add("/language:" + language.trim()); - commands.add("/namespace:" + namespace.trim()); - if (!isEmpty(uri)) commands.add("/uri:" + uri); - if (enableDataBinding) commands.add("/enableDataBinding"); - if (fields) commands.add("/fields"); - if (order) commands.add("/order"); - if (elements != null) { - for (String element : elements) { - commands.add("/element:" + element); + commands.add( new File( xsdFile.trim() ).getAbsolutePath() ); + commands.add( "/o:" + outputDirectory ); + commands.add( "/" + generate.trim() ); + commands.add( "/language:" + language.trim() ); + commands.add( "/namespace:" + namespace.trim() ); + if ( !isEmpty( uri ) ) + { + commands.add( "/uri:" + uri ); + } + if ( enableDataBinding ) + { + commands.add( "/enableDataBinding" ); + } + if ( fields ) + { + commands.add( "/fields" ); + } + if ( order ) + { + commands.add( "/order" ); + } + if ( elements != null ) + { + for ( String element : elements ) + { + commands.add( "/element:" + element ); } } // commands.add("/nologo"); return commands; } - private boolean isEmpty(String value) { - return (value == null || value.trim().equals("")); + private boolean isEmpty( String value ) + { + return ( value == null || value.trim().equals( "" ) ); } }