Modified: incubator/npanday/branches/1.5.0-azuresupport/components/dotnet-vendor/src/test/java/npanday/vendor/impl/VendorInfoTransitionRuleFactoryTest.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/components/dotnet-vendor/src/test/java/npanday/vendor/impl/VendorInfoTransitionRuleFactoryTest.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/components/dotnet-vendor/src/test/java/npanday/vendor/impl/VendorInfoTransitionRuleFactoryTest.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/components/dotnet-vendor/src/test/java/npanday/vendor/impl/VendorInfoTransitionRuleFactoryTest.java Wed Dec 7 09:18:45 2011 @@ -20,18 +20,20 @@ package npanday.vendor.impl; import junit.framework.TestCase; import npanday.InitializationException; -import npanday.vendor.VendorInfoTransitionRule; -import npanday.vendor.VendorInfo; -import npanday.vendor.VendorInfoState; +import npanday.model.settings.DefaultSetup; +import npanday.vendor.SettingsRepository; import npanday.vendor.Vendor; +import npanday.vendor.VendorInfo; +import npanday.vendor.VendorInfoTransitionRule; +import npanday.vendor.VendorRequirement; +import npanday.vendor.VendorRequirementState; import npanday.vendor.VendorTestFactory; -import npanday.model.settings.DefaultSetup; -import org.codehaus.plexus.logging.console.ConsoleLogger; import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.logging.console.ConsoleLogger; -import java.util.List; -import java.util.ArrayList; import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; public class VendorInfoTransitionRuleFactoryTest extends TestCase @@ -47,9 +49,9 @@ public class VendorInfoTransitionRuleFac VendorTestFactory.getDefaultSetup( "MICROSOFT", "2.0.50727", "2.0.50727" ), vendorInfoList ); VendorInfoTransitionRule rule = factory.createVendorInfoSetterForNTF(); - VendorInfo vendorInfo = VendorTestFactory.getVendorInfo( Vendor.MONO, "1.1.18", null ); - VendorInfoState vendorInfoState = rule.process( vendorInfo ); - assertEquals( "Incorrect Vendor State", vendorInfoState, VendorInfoState.NTT ); + VendorRequirement vendorInfo = VendorTestFactory.getVendorRequirement( Vendor.MONO, "1.1.18", null ); + VendorRequirementState vendorRequirementState = rule.process( vendorInfo ); + assertEquals( "Incorrect Vendor State", vendorRequirementState, VendorRequirementState.NTT ); assertEquals( "Incorrect Vendor", Vendor.MONO, vendorInfo.getVendor() ); assertEquals( "2.0.50727", vendorInfo.getFrameworkVersion() ); assertEquals( "1.1.18", vendorInfo.getVendorVersion() ); @@ -66,9 +68,9 @@ public class VendorInfoTransitionRuleFac VendorTestFactory.getDefaultSetup( "MICROSOFT", "2.0.50727", "2.0.50727" ), vendorInfoList ); VendorInfoTransitionRule rule = factory.createVendorInfoSetterForNFF(); - VendorInfo vendorInfo = VendorTestFactory.getVendorInfo( Vendor.MONO, null, null ); - VendorInfoState vendorInfoState = rule.process( vendorInfo ); - assertEquals( "Incorrect Vendor State", vendorInfoState, VendorInfoState.POST_PROCESS ); + VendorRequirement vendorInfo = VendorTestFactory.getVendorRequirement( Vendor.MONO, null, null ); + VendorRequirementState vendorRequirementState = rule.process( vendorInfo ); + assertEquals( "Incorrect Vendor State", vendorRequirementState, VendorRequirementState.EXIT ); assertEquals( Vendor.MONO, vendorInfo.getVendor() ); assertEquals( "2.0.50727", vendorInfo.getFrameworkVersion() ); assertEquals( "1.1.18", vendorInfo.getVendorVersion() ); @@ -85,9 +87,9 @@ public class VendorInfoTransitionRuleFac VendorTestFactory.getDefaultSetup( "MONO", "1.1.18", "1.1.4322" ), vendorInfoList ); VendorInfoTransitionRule rule = factory.createVendorInfoSetterForNFF(); - VendorInfo vendorInfo = VendorTestFactory.getVendorInfo( Vendor.MONO, null, null ); - VendorInfoState vendorInfoState = rule.process( vendorInfo ); - assertEquals( "Incorrect Vendor State", vendorInfoState, VendorInfoState.POST_PROCESS ); + VendorRequirement vendorInfo = VendorTestFactory.getVendorRequirement( Vendor.MONO, null, null ); + VendorRequirementState vendorRequirementState = rule.process( vendorInfo ); + assertEquals( "Incorrect Vendor State", vendorRequirementState, VendorRequirementState.EXIT ); assertEquals( Vendor.MONO, vendorInfo.getVendor() ); assertEquals( "1.1.4322", vendorInfo.getFrameworkVersion() ); assertEquals( "1.1.18", vendorInfo.getVendorVersion() ); @@ -104,9 +106,9 @@ public class VendorInfoTransitionRuleFac VendorTestFactory.getDefaultSetup( "MICROSOFT", "2.0.50727", "2.0.50727" ), vendorInfoList ); VendorInfoTransitionRule rule = factory.createVendorInfoSetterForNFT(); - VendorInfo vendorInfo = VendorTestFactory.getVendorInfo( Vendor.MONO, null, "2.0.50727" ); - VendorInfoState vendorInfoState = rule.process( vendorInfo ); - assertEquals( "Incorrect Vendor State", vendorInfoState, VendorInfoState.NTT ); + VendorRequirement vendorInfo = VendorTestFactory.getVendorRequirement( Vendor.MONO, null, "2.0.50727" ); + VendorRequirementState vendorRequirementState = rule.process( vendorInfo ); + assertEquals( "Incorrect Vendor State", vendorRequirementState, VendorRequirementState.NTT ); assertEquals( Vendor.MONO, vendorInfo.getVendor() ); assertEquals( "2.0.50727", vendorInfo.getFrameworkVersion() ); assertEquals( "1.1.18", vendorInfo.getVendorVersion() ); @@ -122,9 +124,9 @@ public class VendorInfoTransitionRuleFac VendorTestFactory.getDefaultSetup( "MONO", "1.1.18", "2.0.50727" ), vendorInfoList ); VendorInfoTransitionRule rule = factory.createVendorInfoSetterForNFT(); - VendorInfo vendorInfo = VendorTestFactory.getVendorInfo( Vendor.MONO, null, "2.0.50727" ); - VendorInfoState vendorInfoState = rule.process( vendorInfo ); - assertEquals( "Incorrect Vendor State", vendorInfoState, VendorInfoState.NTT ); + VendorRequirement vendorInfo = VendorTestFactory.getVendorRequirement( Vendor.MONO, null, "2.0.50727" ); + VendorRequirementState vendorRequirementState = rule.process( vendorInfo ); + assertEquals( "Incorrect Vendor State", vendorRequirementState, VendorRequirementState.NTT ); assertEquals( Vendor.MONO, vendorInfo.getVendor() ); assertEquals( "2.0.50727", vendorInfo.getFrameworkVersion() ); assertEquals( "1.1.18", vendorInfo.getVendorVersion() ); @@ -137,9 +139,9 @@ public class VendorInfoTransitionRuleFac VendorTestFactory.getDefaultSetup( "MICROSOFT", "2.0.50727", "2.0.50727" ), new ArrayList<VendorInfo>() ); VendorInfoTransitionRule rule = factory.createVendorInfoSetterForNFT(); - VendorInfo vendorInfo = VendorTestFactory.getVendorInfo( Vendor.MONO, null, "2.0.50727" ); - VendorInfoState vendorInfoState = rule.process( vendorInfo ); - assertEquals( "Incorrect Vendor State", vendorInfoState, VendorInfoState.POST_PROCESS ); + VendorRequirement vendorInfo = VendorTestFactory.getVendorRequirement( Vendor.MONO, null, "2.0.50727" ); + VendorRequirementState vendorRequirementState = rule.process( vendorInfo ); + assertEquals( "Incorrect Vendor State", vendorRequirementState, VendorRequirementState.EXIT ); } private static class Factory @@ -148,7 +150,7 @@ public class VendorInfoTransitionRuleFac List<VendorInfo> vendorInfos ) throws NoSuchFieldException, IllegalAccessException { - SettingsRepository settingsRepository = new SettingsRepository(); + FileBasedSettingsRepository settingsRepository = new FileBasedSettingsRepository(); settingsRepository.enableLogging( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) ); Field field = settingsRepository.getClass().getDeclaredField( "defaultSetup" );
Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-aspx-plugin/src/main/java/npanday/plugin/aspx/AspxCompilerMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-aspx-plugin/src/main/java/npanday/plugin/aspx/AspxCompilerMojo.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-aspx-plugin/src/main/java/npanday/plugin/aspx/AspxCompilerMojo.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-aspx-plugin/src/main/java/npanday/plugin/aspx/AspxCompilerMojo.java Wed Dec 7 09:18:45 2011 @@ -375,16 +375,9 @@ public class AspxCompilerMojo compilerRequirement.setFrameworkVersion( frameworkVersion ); compilerRequirement.setProfile( profile ); compilerRequirement.setVendorVersion( vendorVersion ); - try + if ( vendor != null ) { - if ( vendor != null ) - { - compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) ); - } - } - catch ( PlatformUnsupportedException e ) - { - throw new MojoExecutionException( "NPANDAY-900-001: Unknown Vendor: Vendor = " + vendor, e ); + compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) ); } return compilerRequirement; Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/AssemblyInfoGeneratorMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/AssemblyInfoGeneratorMojo.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/AssemblyInfoGeneratorMojo.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/AssemblyInfoGeneratorMojo.java Wed Dec 7 09:18:45 2011 @@ -19,14 +19,14 @@ package npanday.plugin.compile; import npanday.ArtifactTypeHelper; +import npanday.PlatformUnsupportedException; import npanday.assembler.AssemblerContext; import npanday.assembler.AssemblyInfo; import npanday.assembler.AssemblyInfoException; import npanday.assembler.AssemblyInfoMarshaller; import npanday.vendor.Vendor; -import npanday.vendor.VendorFactory; import npanday.vendor.VendorInfo; -import npanday.vendor.VendorUnsupportedException; +import npanday.vendor.VendorRequirement; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; @@ -165,33 +165,25 @@ public class AssemblyInfoGeneratorMojo //TODO: Investigate the affect of not setting isDefault and profile. In the case of executables, this is //managed by the framework. I intended to keep vendor info and state machine processor out of the // Mojos. Unable to do so for this case. Look at new API. - VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo(); - try - { - vendorInfo.setFrameworkVersion( frameworkVersion ); - if ( vendor != null ) - { - vendorInfo.setVendor( VendorFactory.createVendorFromName( vendor ) ); - } - vendorInfo.setVendorVersion( vendorVersion ); - } - catch ( VendorUnsupportedException e ) - { - throw new MojoExecutionException( "NPANDAY-902-007: Vendor not supported: Vendor = " + vendor, e); - } - + VendorRequirement vendorRequirement = new VendorRequirement(vendor, vendorVersion, frameworkVersion); AssemblyInfo assemblyInfo = assemblerContext.getAssemblyInfo(); assemblyInfo.setCustomStringAttributes(this.assemblyInfo); + VendorInfo vendorInfo; try { - stateMachineProcessor.process( vendorInfo ); + vendorInfo = stateMachineProcessor.process( vendorRequirement ); } catch ( npanday.vendor.IllegalStateException e ) { throw new MojoExecutionException( "NPANDAY-902-008: Illegal state of vendor info: Message = " + e.getMessage(), e); } + catch ( PlatformUnsupportedException e ) + { + throw new MojoExecutionException( + "NPANDAY-902-009: Platform is unsupported: Message = " + e.getMessage(), e); + } if ( vendorInfo.getVendor().equals( Vendor.MICROSOFT ) && vendorInfo.getVendorVersion().equals( "1.1.4322" ) ) { Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/CompilerMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/CompilerMojo.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/CompilerMojo.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/CompilerMojo.java Wed Dec 7 09:18:45 2011 @@ -81,21 +81,9 @@ public final class CompilerMojo compilerRequirement.setFrameworkVersion( frameworkVersion ); compilerRequirement.setProfile( profile ); compilerRequirement.setVendorVersion( vendorVersion ); - try - { - if ( vendor != null ) - { - compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) ); - } - } - catch ( PlatformUnsupportedException e ) - { - throw new MojoExecutionException( "NPANDAY-900-001: Unknown Vendor: Vendor = " + vendor, e ); - } + compilerRequirement.setVendor(vendor); return compilerRequirement; - - } protected CompilerConfig getCompilerConfig() throws MojoExecutionException Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/TestCompilerMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/TestCompilerMojo.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/TestCompilerMojo.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-compile-plugin/src/main/java/npanday/plugin/compile/TestCompilerMojo.java Wed Dec 7 09:18:45 2011 @@ -19,18 +19,15 @@ package npanday.plugin.compile; -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.util.FileUtils; -import npanday.PlatformUnsupportedException; import npanday.ArtifactType; -import npanday.executable.ExecutionException; +import npanday.executable.compiler.CompilerConfig; +import npanday.executable.compiler.CompilerRequirement; +import npanday.executable.compiler.KeyInfo; import npanday.vendor.VendorFactory; -import npanday.executable.compiler.*; +import org.apache.maven.plugin.MojoExecutionException; -import java.util.ArrayList; import java.io.File; +import java.util.ArrayList; /** * Compiles test classes. @@ -100,19 +97,11 @@ public final class TestCompilerMojo compilerRequirement.setFrameworkVersion( testFrameworkVersion ); compilerRequirement.setProfile( "FULL" ); compilerRequirement.setVendorVersion( testVendorVersion ); - try + if ( vendor != null ) { - if ( vendor != null ) - { - compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) ); - } - } - catch ( PlatformUnsupportedException e ) - { - throw new MojoExecutionException( "NPANDAY-900-000: Unknown Vendor: Vendor = " + vendor, e ); + compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) ); } - return compilerRequirement; } Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-ilmerge-plugin/src/main/java/npanday/plugin/ilmerge/AssemblyMerger.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-ilmerge-plugin/src/main/java/npanday/plugin/ilmerge/AssemblyMerger.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-ilmerge-plugin/src/main/java/npanday/plugin/ilmerge/AssemblyMerger.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-ilmerge-plugin/src/main/java/npanday/plugin/ilmerge/AssemblyMerger.java Wed Dec 7 09:18:45 2011 @@ -467,21 +467,8 @@ public class AssemblyMerger extends Abst compilerRequirement.setFrameworkVersion( frameworkVersion ); compilerRequirement.setProfile( profile ); compilerRequirement.setVendorVersion( vendorVersion ); - try - { - if ( vendor != null ) - { - compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) ); - } - } - catch ( PlatformUnsupportedException e ) - { - throw new MojoExecutionException( "NPANDAY-900-001: Unknown Vendor: Vendor = " + vendor, e ); - } - + compilerRequirement.setVendor( vendor ); return compilerRequirement; - - } protected CompilerConfig getCompilerConfig() throws MojoExecutionException Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java Wed Dec 7 09:18:45 2011 @@ -18,18 +18,16 @@ */ package npanday.plugin.generator; +import npanday.PlatformUnsupportedException; +import npanday.executable.ExecutionException; +import npanday.vendor.VendorRequirement; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import java.io.File; -import java.util.List; import java.util.ArrayList; - -import npanday.PlatformUnsupportedException; -import npanday.executable.ExecutionException; -import npanday.vendor.VendorFactory; -import npanday.vendor.VendorInfo; +import java.util.List; /** * Generates Java Bindings for .NET Mojos. @@ -105,13 +103,8 @@ public class MojoGeneratorMojo try { List<String> commands = new ArrayList<String>(); - VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo(); - if ( vendor != null ) - { - vendorInfo.setVendor( VendorFactory.createVendorFromName( vendor ) ); - } - vendorInfo.setFrameworkVersion( frameworkVersion ); - vendorInfo.setVendorVersion( vendorVersion ); + VendorRequirement vendorRequirement = new VendorRequirement( vendor, vendorVersion, frameworkVersion ); + File targetAssemblyFile = new File( project.getBuild().getDirectory() + "/" + project.getArtifactId() + ".dll" ); commands.add( "targetAssemblyFile=" + targetAssemblyFile.getAbsolutePath() ); @@ -120,7 +113,7 @@ public class MojoGeneratorMojo commands.add( "artifactId=" + project.getArtifactId() ); commands.add( "artifactVersion=" + project.getVersion()); netExecutableFactory.getNetExecutableFromRepository( "org.apache.npanday.plugins", "NPanday.Plugin.MojoGenerator", - vendorInfo, localRepository, commands, + vendorRequirement, localRepository, commands, true ).execute(); } catch ( PlatformUnsupportedException e ) Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-test-plugin/src/main/java/npanday/plugin/test/TesterMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-test-plugin/src/main/java/npanday/plugin/test/TesterMojo.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-test-plugin/src/main/java/npanday/plugin/test/TesterMojo.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/maven-test-plugin/src/main/java/npanday/plugin/test/TesterMojo.java Wed Dec 7 09:18:45 2011 @@ -31,6 +31,7 @@ import npanday.vendor.IllegalStateExcept import npanday.vendor.StateMachineProcessor; import npanday.vendor.Vendor; import npanday.vendor.VendorInfo; +import npanday.vendor.VendorRequirement; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; @@ -390,20 +391,20 @@ extends AbstractMojo FileUtils.mkdir( reportsDirectory ); - VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo(); - getLog().debug( "NPANDAY-1100-014.1: Vendor info:" + vendorInfo ); - vendorInfo.setVendorVersion( "" ); - vendorInfo.setFrameworkVersion( executionFrameworkVersion ); - getLog().debug( "NPANDAY-1100-014.2: Vendor info:" + vendorInfo ); - + VendorRequirement vendorRequirement = new VendorRequirement( (Vendor)null, null, executionFrameworkVersion ); + getLog().debug( "NPANDAY-1100-014.2: Vendor info:" + vendorRequirement ); + VendorInfo vendorInfo; try { - getLog().debug( "NPANDAY-1100-015: Processor type:" + processor ); - processor.process( vendorInfo ); + vendorInfo = processor.process( vendorRequirement ); } catch ( IllegalStateException e ) { - throw new MojoExecutionException( e.getMessage(), e ); + throw new MojoExecutionException( "NPANDAY-1100-016: Error on determining the vendor info", e ); + } + catch ( PlatformUnsupportedException e ) + { + throw new MojoExecutionException( "NPANDAY-1100-017: Error on determining the vendor info", e ); } //List<String> commands = getCommandsFor( vendorInfo.getVendor() ); getLog().debug( "NPANDAY-1100-014.3: Vendor info:" + vendorInfo ); Modified: incubator/npanday/branches/1.5.0-azuresupport/plugins/netplugins/NPanday.Plugin.Settings/javabinding/src/main/java/NPanday/Plugin/Settings/SettingsGeneratorMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/branches/1.5.0-azuresupport/plugins/netplugins/NPanday.Plugin.Settings/javabinding/src/main/java/NPanday/Plugin/Settings/SettingsGeneratorMojo.java?rev=1211347&r1=1211346&r2=1211347&view=diff ============================================================================== --- incubator/npanday/branches/1.5.0-azuresupport/plugins/netplugins/NPanday.Plugin.Settings/javabinding/src/main/java/NPanday/Plugin/Settings/SettingsGeneratorMojo.java (original) +++ incubator/npanday/branches/1.5.0-azuresupport/plugins/netplugins/NPanday.Plugin.Settings/javabinding/src/main/java/NPanday/Plugin/Settings/SettingsGeneratorMojo.java Wed Dec 7 09:18:45 2011 @@ -25,7 +25,7 @@ import npanday.registry.NPandayRepositor import npanday.registry.RepositoryRegistry; import npanday.vendor.SettingsException; import npanday.vendor.SettingsUtil; -import npanday.vendor.impl.SettingsRepository; +import npanday.vendor.SettingsRepository; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -35,6 +35,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import javax.naming.OperationNotSupportedException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.io.File; @@ -271,8 +272,10 @@ public class SettingsGeneratorMojo public void postExecute() throws MojoExecutionException, MojoFailureException { + // TODO: proper error handling try { + // TODO: let the registry be injected as @component RepositoryRegistry repositoryRegistry = (RepositoryRegistry) container.lookup( RepositoryRegistry.ROLE ); SettingsRepository settingsRepository = (SettingsRepository) repositoryRegistry.find( "npanday-settings" ); if ( settingsRepository != null ) @@ -292,5 +295,9 @@ public class SettingsGeneratorMojo { e.printStackTrace(); } + catch ( OperationNotSupportedException e ) + { + e.printStackTrace(); + } } }
