Author: khmarbaise Date: Mon Nov 9 21:32:15 2015 New Revision: 1713543 URL: http://svn.apache.org/viewvc?rev=1713543&view=rev Log: [MEAR-208] Upgrade to Maven 3.0 compatiblity + JDK 6
Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/pom.xml?rev=1713543&r1=1713542&r2=1713543&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-ear-plugin/pom.xml Mon Nov 9 21:32:15 2015 @@ -75,19 +75,14 @@ </contributors> <properties> - <mavenArchiverVersion>2.6</mavenArchiverVersion> - <mavenFilteringVersion>1.3</mavenFilteringVersion> - <mavenVersion>2.2.1</mavenVersion> + <mavenArchiverVersion>3.0.0</mavenArchiverVersion> + <mavenFilteringVersion>3.0.0-SNAPSHOT</mavenFilteringVersion> + <mavenVersion>3.0</mavenVersion> </properties> <dependencies> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> - <version>${mavenVersion}</version> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>${mavenVersion}</version> </dependency> @@ -146,7 +141,7 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.10</version> + <version>4.11</version> <scope>test</scope> </dependency> <dependency> Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java?rev=1713543&r1=1713542&r2=1713543&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java (original) +++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java Mon Nov 9 21:32:15 2015 @@ -111,13 +111,12 @@ public abstract class AbstractEarMojo private Boolean includeLibInApplicationXml = Boolean.FALSE; /** - * The file name mapping to use for all dependencies included in the EAR file. - * The following values are valid {@code standard}, {code no-version}, {@code full}, {@code no-version-for-ejb}. - * The {@code standard} means the filename is the artifactId incl. the version of the artifact. - * The {@code no-version} means the files is only the artifactId without the version. - * The {@code full} means the filename is the groupId+artifactId+version of the artifact. - * The {@code no-version-for-ejb} means the filename is the artifactId without the version in case of {@code EJB} - * type. + * The file name mapping to use for all dependencies included in the EAR file. The following values are valid + * {@code standard}, {@code no-version}, {@code full}, {@code no-version-for-ejb}. The {@code standard} means the + * filename is the artifactId incl. the version of the artifact. The {@code no-version} means the files is only the + * artifactId without the version. The {@code full} means the filename is the groupId+artifactId+version of the + * artifact. The {@code no-version-for-ejb} means the filename is the artifactId without the version in case of + * {@code EJB} type. */ @Parameter private String fileNameMapping; @@ -163,7 +162,7 @@ public abstract class AbstractEarMojo @Component private MavenResourcesFiltering mavenResourcesFiltering; - + private List<EarModule> earModules; private List<EarModule> allModules; @@ -247,9 +246,8 @@ public abstract class AbstractEarMojo if ( !isArtifactRegistered( artifact, allModules ) && !artifact.isOptional() && filter.include( artifact ) ) { - EarModule module = - EarModuleFactory.newEarModule( artifact, javaEEVersion, defaultLibBundleDir, - includeLibInApplicationXml, typeMappingService ); + EarModule module = EarModuleFactory.newEarModule( artifact, javaEEVersion, defaultLibBundleDir, + includeLibInApplicationXml, typeMappingService ); module.setEarExecutionContext( earExecutionContext ); allModules.add( module ); } @@ -346,54 +344,47 @@ public abstract class AbstractEarMojo } else { - try + String childVersion = jboss.getChild( JbossConfiguration.VERSION ).getValue(); + if ( childVersion == null ) + { + getLog().info( "JBoss version not set, using JBoss 4 by default" ); + childVersion = JbossConfiguration.VERSION_4; + } + final String securityDomain = jboss.getChild( JbossConfiguration.SECURITY_DOMAIN ).getValue(); + final String unauthenticatedPrincipal = + jboss.getChild( JbossConfiguration.UNAUHTHENTICTED_PRINCIPAL ).getValue(); + + final PlexusConfiguration loaderRepositoryEl = jboss.getChild( JbossConfiguration.LOADER_REPOSITORY ); + final String loaderRepository = loaderRepositoryEl.getValue(); + final String loaderRepositoryClass = + loaderRepositoryEl.getAttribute( JbossConfiguration.LOADER_REPOSITORY_CLASS_ATTRIBUTE ); + final PlexusConfiguration loaderRepositoryConfigEl = + jboss.getChild( JbossConfiguration.LOADER_REPOSITORY_CONFIG ); + final String loaderRepositoryConfig = loaderRepositoryConfigEl.getValue(); + final String configParserClass = + loaderRepositoryConfigEl.getAttribute( JbossConfiguration.CONFIG_PARSER_CLASS_ATTRIBUTE ); + + final String jmxName = jboss.getChild( JbossConfiguration.JMX_NAME ).getValue(); + final String moduleOrder = jboss.getChild( JbossConfiguration.MODULE_ORDER ).getValue(); + + final List<String> dataSources = new ArrayList<String>(); + final PlexusConfiguration dataSourcesEl = jboss.getChild( JbossConfiguration.DATASOURCES ); + if ( dataSourcesEl != null ) { - String childVersion = jboss.getChild( JbossConfiguration.VERSION ).getValue(); - if ( childVersion == null ) - { - getLog().info( "JBoss version not set, using JBoss 4 by default" ); - childVersion = JbossConfiguration.VERSION_4; - } - final String securityDomain = jboss.getChild( JbossConfiguration.SECURITY_DOMAIN ).getValue(); - final String unauthenticatedPrincipal = - jboss.getChild( JbossConfiguration.UNAUHTHENTICTED_PRINCIPAL ).getValue(); - - final PlexusConfiguration loaderRepositoryEl = jboss.getChild( JbossConfiguration.LOADER_REPOSITORY ); - final String loaderRepository = loaderRepositoryEl.getValue(); - final String loaderRepositoryClass = - loaderRepositoryEl.getAttribute( JbossConfiguration.LOADER_REPOSITORY_CLASS_ATTRIBUTE ); - final PlexusConfiguration loaderRepositoryConfigEl = - jboss.getChild( JbossConfiguration.LOADER_REPOSITORY_CONFIG ); - final String loaderRepositoryConfig = loaderRepositoryConfigEl.getValue(); - final String configParserClass = - loaderRepositoryConfigEl.getAttribute( JbossConfiguration.CONFIG_PARSER_CLASS_ATTRIBUTE ); - - final String jmxName = jboss.getChild( JbossConfiguration.JMX_NAME ).getValue(); - final String moduleOrder = jboss.getChild( JbossConfiguration.MODULE_ORDER ).getValue(); - - final List<String> dataSources = new ArrayList<String>(); - final PlexusConfiguration dataSourcesEl = jboss.getChild( JbossConfiguration.DATASOURCES ); - if ( dataSourcesEl != null ) - { - final PlexusConfiguration[] dataSourcesConfig = - dataSourcesEl.getChildren( JbossConfiguration.DATASOURCE ); - for ( PlexusConfiguration dataSourceConfig : dataSourcesConfig ) - { - dataSources.add( dataSourceConfig.getValue() ); + final PlexusConfiguration[] dataSourcesConfig = + dataSourcesEl.getChildren( JbossConfiguration.DATASOURCE ); + for ( PlexusConfiguration dataSourceConfig : dataSourcesConfig ) + { + dataSources.add( dataSourceConfig.getValue() ); - } } - final String libraryDirectory = jboss.getChild( JbossConfiguration.LIBRARY_DIRECTORY ).getValue(); - jbossConfiguration = - new JbossConfiguration( childVersion, securityDomain, unauthenticatedPrincipal, jmxName, - loaderRepository, moduleOrder, dataSources, libraryDirectory, - loaderRepositoryConfig, loaderRepositoryClass, configParserClass ); - } - catch ( PlexusConfigurationException e ) - { - throw new EarPluginException( "Invalid JBoss configuration", e ); } + final String libraryDirectory = jboss.getChild( JbossConfiguration.LIBRARY_DIRECTORY ).getValue(); + jbossConfiguration = + new JbossConfiguration( childVersion, securityDomain, unauthenticatedPrincipal, jmxName, + loaderRepository, moduleOrder, dataSources, libraryDirectory, + loaderRepositoryConfig, loaderRepositoryClass, configParserClass ); } } } Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java?rev=1713543&r1=1713542&r2=1713543&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java (original) +++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java Mon Nov 9 21:32:15 2015 @@ -33,7 +33,6 @@ import org.apache.maven.plugins.annotati import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.codehaus.plexus.configuration.PlexusConfiguration; -import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.codehaus.plexus.interpolation.InterpolationException; import org.codehaus.plexus.interpolation.Interpolator; import org.codehaus.plexus.interpolation.MapBasedValueSource; @@ -281,37 +280,29 @@ public class GenerateApplicationXmlMojo { return result; } - try + final PlexusConfiguration[] securityRoles = security.getChildren( SecurityRole.SECURITY_ROLE ); + + for ( PlexusConfiguration securityRole : securityRoles ) { - final PlexusConfiguration[] securityRoles = security.getChildren( SecurityRole.SECURITY_ROLE ); + final String id = securityRole.getAttribute( SecurityRole.ID_ATTRIBUTE ); + final String childRoleName = securityRole.getChild( SecurityRole.ROLE_NAME ).getValue(); + final String childRoleNameId = + securityRole.getChild( SecurityRole.ROLE_NAME ).getAttribute( SecurityRole.ID_ATTRIBUTE ); + final String childDescription = securityRole.getChild( SecurityRole.DESCRIPTION ).getValue(); + final String childDescriptionId = + securityRole.getChild( SecurityRole.DESCRIPTION ).getAttribute( SecurityRole.ID_ATTRIBUTE ); - for ( PlexusConfiguration securityRole : securityRoles ) + if ( childRoleName == null ) { - final String id = securityRole.getAttribute( SecurityRole.ID_ATTRIBUTE ); - final String childRoleName = securityRole.getChild( SecurityRole.ROLE_NAME ).getValue(); - final String childRoleNameId = - securityRole.getChild( SecurityRole.ROLE_NAME ).getAttribute( SecurityRole.ID_ATTRIBUTE ); - final String childDescription = securityRole.getChild( SecurityRole.DESCRIPTION ).getValue(); - final String childDescriptionId = - securityRole.getChild( SecurityRole.DESCRIPTION ).getAttribute( SecurityRole.ID_ATTRIBUTE ); - - if ( childRoleName == null ) - { - throw new EarPluginException( "Invalid security-role configuration, role-name could not be null." ); - } - else - { - result.add( new SecurityRole( childRoleName, childRoleNameId, id, childDescription, - childDescriptionId ) ); - } + throw new EarPluginException( "Invalid security-role configuration, role-name could not be null." ); + } + else + { + result.add( new SecurityRole( childRoleName, childRoleNameId, id, childDescription, + childDescriptionId ) ); } - return result; - } - catch ( PlexusConfigurationException e ) - { - throw new EarPluginException( "Invalid security-role configuration", e ); } - + return result; } /** @@ -361,7 +352,8 @@ public class GenerateApplicationXmlMojo for ( PlexusConfiguration envEntry : allEnvEntries ) { // CHECKSTYLE_OFF: LineLength - final String childDescription = interpolate( ssi, envEntry.getChild( EnvEntry.DESCRIPTION ).getValue() ); + final String childDescription = + interpolate( ssi, envEntry.getChild( EnvEntry.DESCRIPTION ).getValue() ); final String childEnvEntryName = interpolate( ssi, envEntry.getChild( EnvEntry.ENV_ENTRY_NAME ).getValue() ); final String childEnvEntryType = @@ -382,10 +374,6 @@ public class GenerateApplicationXmlMojo } return result; } - catch ( PlexusConfigurationException e ) - { - throw new EarPluginException( "Invalid env-entry configuration", e ); - } catch ( InterpolationException e ) { throw new EarPluginException( "Interpolation exception:", e ); @@ -418,7 +406,8 @@ public class GenerateApplicationXmlMojo for ( PlexusConfiguration ejbEntry : allEjbEntries ) { // CHECKSTYLE_OFF: LineLength - final String childDescription = interpolate( ssi, ejbEntry.getChild( EnvEntry.DESCRIPTION ).getValue() ); + final String childDescription = + interpolate( ssi, ejbEntry.getChild( EnvEntry.DESCRIPTION ).getValue() ); final String childEjbEntryName = interpolate( ssi, ejbEntry.getChild( EjbRef.EJB_NAME ).getValue() ); final String childEjbEntryType = interpolate( ssi, ejbEntry.getChild( EjbRef.EJB_TYPE ).getValue() ); final String childEjbLookupNameValue = @@ -437,10 +426,6 @@ public class GenerateApplicationXmlMojo } return result; } - catch ( PlexusConfigurationException e ) - { - throw new EarPluginException( "Invalid ejb-ref configuration", e ); - } catch ( InterpolationException e ) { throw new EarPluginException( "Interpolation exception:", e );