Author: dkulp Date: Mon Jul 8 13:56:05 2013 New Revision: 1500733 URL: http://svn.apache.org/r1500733 Log: Update deps to "Java5" versions, update code to use Java5 apis to remove warnings.
Modified: maven/plugins/trunk/maven-remote-resources-plugin/pom.xml maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ArtifactStub.java maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBasicStub.java maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ModelStub.java Modified: maven/plugins/trunk/maven-remote-resources-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/pom.xml?rev=1500733&r1=1500732&r2=1500733&view=diff ============================================================================== --- maven/plugins/trunk/maven-remote-resources-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-remote-resources-plugin/pom.xml Mon Jul 8 13:56:05 2013 @@ -43,7 +43,7 @@ under the License. </description> <prerequisites> - <maven>${mavenVersion}</maven> + <maven>2.2.1</maven> </prerequisites> <scm> @@ -57,9 +57,8 @@ under the License. </issueManagement> <properties> - <mavenVersion>2.0.6</mavenVersion> + <mavenVersion>2.2.1</mavenVersion> <mavenFilteringVersion>1.1</mavenFilteringVersion> - <mavenPluginVersion>3.2</mavenPluginVersion> <sitePluginVersion>3.2</sitePluginVersion> </properties> @@ -104,7 +103,6 @@ under the License. <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> - <version>${mavenPluginVersion}</version> <scope>provided</scope> </dependency> @@ -117,7 +115,7 @@ under the License. <dependency> <groupId>org.apache.maven.shared</groupId> <artifactId>maven-common-artifact-filters</artifactId> - <version>1.0</version> + <version>1.4</version> </dependency> <dependency> <groupId>org.apache.maven.shared</groupId> @@ -128,23 +126,8 @@ under the License. <!-- plexus --> <dependency> <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-container-default</artifactId> - <version>1.0-alpha-9</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-interpolation</artifactId> - <version>1.12</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-resources</artifactId> - <version>1.0-alpha-5</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.5.12</version> + <version>1.0-alpha-7</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> @@ -157,6 +140,11 @@ under the License. </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <version>1.12</version> + </dependency> <!-- other --> <dependency> @@ -205,7 +193,6 @@ under the License. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> - <version>${mavenPluginVersion}</version> <configuration> <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> </configuration> Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java?rev=1500733&r1=1500732&r2=1500733&view=diff ============================================================================== --- maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java (original) +++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java Mon Jul 8 13:56:05 2013 @@ -51,8 +51,8 @@ import org.apache.maven.shared.artifact. import org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter; import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts; import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter; +import org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter; import org.apache.maven.shared.artifact.filter.collection.ScopeFilter; -import org.apache.maven.shared.artifact.filter.collection.TransitivityFilter; import org.apache.maven.shared.filtering.MavenFileFilter; import org.apache.maven.shared.filtering.MavenFileFilterRequest; import org.apache.maven.shared.filtering.MavenFilteringException; @@ -421,7 +421,7 @@ public class ProcessRemoteResourcesMojo { try { - supplementalModels = new String[]{ sups.toURL().toString() }; + supplementalModels = new String[]{ sups.toURI().toURL().toString() }; } catch ( MalformedURLException e ) { @@ -546,7 +546,7 @@ public class ProcessRemoteResourcesMojo { try { - locator.addSearchPath( "jar", "jar:" + artifact.toURL().toExternalForm() ); + locator.addSearchPath( "jar", "jar:" + artifact.toURI().toURL().toExternalForm() ); } catch ( MalformedURLException e ) { @@ -579,7 +579,7 @@ public class ProcessRemoteResourcesMojo depArtifacts = project.getDependencyArtifacts(); } - filter.addFilter( new TransitivityFilter( depArtifacts, this.excludeTransitive ) ); + filter.addFilter( new ProjectTransitivityFilter( depArtifacts, this.excludeTransitive ) ); filter.addFilter( new ScopeFilter( this.includeScope, this.excludeScope ) ); filter.addFilter( new GroupIdFilter( this.includeGroupIds, this.excludeGroupIds ) ); filter.addFilter( new ArtifactIdFilter( this.includeArtifactIds, this.excludeArtifactIds ) ); @@ -649,7 +649,6 @@ public class ProcessRemoteResourcesMojo return projects; } - @SuppressWarnings( "unchecked" ) private Set<Artifact> resolveProjectArtifacts() throws MojoExecutionException { @@ -838,7 +837,6 @@ public class ProcessRemoteResourcesMojo return false; } - @SuppressWarnings( "unchecked" ) private MavenFileFilterRequest setupRequest( Resource resource, File source, File file ) { MavenFileFilterRequest req = new MavenFileFilterRequest(); @@ -958,7 +956,6 @@ public class ProcessRemoteResourcesMojo } } - @SuppressWarnings( "unchecked" ) private List<File> downloadBundles( List<String> bundles ) throws MojoExecutionException { @@ -1086,7 +1083,8 @@ public class ProcessRemoteResourcesMojo { if ( bundle.getSourceEncoding() == null ) { - velocity.getEngine().mergeTemplate( bundleResource, context, writer ); + velocity.getEngine().mergeTemplate( bundleResource, "ISO-8859-1", + context, writer ); } else { @@ -1342,7 +1340,6 @@ public class ProcessRemoteResourcesMojo class ProjectComparator implements Comparator<MavenProject> { - @SuppressWarnings( "unchecked" ) public int compare( MavenProject p1, MavenProject p2 ) { return p1.getArtifact().compareTo( p2.getArtifact() ); Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java?rev=1500733&r1=1500732&r2=1500733&view=diff ============================================================================== --- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java (original) +++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java Mon Jul 8 13:56:05 2013 @@ -479,11 +479,11 @@ public class RemoteResourcesMojoTest String bundles[] ) throws Exception { - return lookupProcessMojoWithSettings( project, new ArrayList( Arrays.asList( bundles ) ) ); + return lookupProcessMojoWithSettings( project, new ArrayList<String>( Arrays.asList( bundles ) ) ); } protected ProcessRemoteResourcesMojo lookupProcessMojoWithSettings( final MavenProject project, - ArrayList bundles ) + ArrayList<String> bundles ) throws Exception { final ProcessRemoteResourcesMojo mojo = lookupProcessMojo(); @@ -492,7 +492,7 @@ public class RemoteResourcesMojoTest null, //Settings settings, null, //ArtifactRepository localRepository, null, //EventDispatcher eventDispatcher, - new ReactorManager(new ArrayList()), + new ReactorManager(new ArrayList<MavenProject>()), Arrays.asList( new String[] {"install"} ), project.getBasedir().toString(), new Properties(), @@ -510,6 +510,6 @@ public class RemoteResourcesMojoTest protected ProcessRemoteResourcesMojo lookupProcessMojoWithDefaultSettings( final MavenProject project ) throws Exception { - return lookupProcessMojoWithSettings( project, new ArrayList() ); + return lookupProcessMojoWithSettings( project, new ArrayList<String>() ); } } Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ArtifactStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ArtifactStub.java?rev=1500733&r1=1500732&r2=1500733&view=diff ============================================================================== --- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ArtifactStub.java (original) +++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ArtifactStub.java Mon Jul 8 13:56:05 2013 @@ -172,9 +172,9 @@ public class ArtifactStub } - public Collection getMetadataList() + public Collection<ArtifactMetadata> getMetadataList() { - return new LinkedList(); + return new LinkedList<ArtifactMetadata>(); } public void setRepository( ArtifactRepository remoteRepository ) @@ -217,12 +217,12 @@ public class ArtifactStub return artifactHandler; } - public List getDependencyTrail() + public List<String> getDependencyTrail() { - return new LinkedList(); + return new LinkedList<String>(); } - public void setDependencyTrail( List dependencyTrail ) + public void setDependencyTrail(List<String> dependencyTrail) { } @@ -293,12 +293,12 @@ public class ArtifactStub release = _release; } - public List getAvailableVersions() + public List<ArtifactVersion> getAvailableVersions() { - return new LinkedList(); + return new LinkedList<ArtifactVersion>(); } - public void setAvailableVersions( List versions ) + public void setAvailableVersions(List<ArtifactVersion> versions) { } @@ -325,8 +325,13 @@ public class ArtifactStub return true; } - public int compareTo( Object object ) - { + public int compareTo(Artifact o) { return 0; } + + public ArtifactMetadata getMetadata(Class<?> metadataClass) { + return null; + } + + } Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBasicStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBasicStub.java?rev=1500733&r1=1500732&r2=1500733&view=diff ============================================================================== --- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBasicStub.java (original) +++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBasicStub.java Mon Jul 8 13:56:05 2013 @@ -25,7 +25,6 @@ import java.util.LinkedList; import java.util.Properties; import org.apache.maven.artifact.Artifact; -import org.apache.maven.model.Model; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; @@ -44,7 +43,7 @@ public class MavenProjectBasicStub protected String description; - protected ModelStub model; + protected ModelStub modelStub; protected File file; @@ -56,7 +55,7 @@ public class MavenProjectBasicStub // most values are hardcoded to have a controlled environment super( new ModelStub() ); - model = (ModelStub) getModel(); + modelStub = (ModelStub) getModel(); properties = new Properties(); artifact = new ArtifactStub(); identifier = id; @@ -86,11 +85,6 @@ public class MavenProjectBasicStub description = desc; } - public Model getModel() - { - return model; - } - public String getDescription() { if ( description == null ) @@ -150,15 +144,15 @@ public class MavenProjectBasicStub { // the pom should be located in the isolated dummy root super.setFile( new File( getBasedir(), "pom.xml" ) ); - super.setDependencyArtifacts( new HashSet() ); - super.setArtifacts( new HashSet() ); - super.setPluginArtifacts( new HashSet() ); - super.setReportArtifacts( new HashSet() ); - super.setExtensionArtifacts( new HashSet() ); - super.setRemoteArtifactRepositories( new LinkedList() ); - super.setPluginArtifactRepositories( new LinkedList() ); - super.setCollectedProjects( new LinkedList() ); - super.setActiveProfiles( new LinkedList() ); + super.setDependencyArtifacts( new HashSet<Object>() ); + super.setArtifacts( new HashSet<Object>() ); + super.setPluginArtifacts( new HashSet<Object>() ); + super.setReportArtifacts( new HashSet<Object>() ); + super.setExtensionArtifacts( new HashSet<Object>() ); + super.setRemoteArtifactRepositories( new LinkedList<Object>() ); + super.setPluginArtifactRepositories( new LinkedList<Object>() ); + super.setCollectedProjects( new LinkedList<Object>() ); + super.setActiveProfiles( new LinkedList<Object>() ); super.setOriginalModel( null ); super.setExecutionProject( this ); super.setArtifact( artifact ); Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java?rev=1500733&r1=1500732&r2=1500733&view=diff ============================================================================== --- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java (original) +++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java Mon Jul 8 13:56:05 2013 @@ -63,17 +63,17 @@ public class MavenProjectBuildStub protected String targetTestResourcesDirectory; - protected ArrayList targetClassesList; + protected ArrayList<String> targetClassesList; - protected ArrayList sourceFileList; + protected ArrayList<String> sourceFileList; - protected ArrayList resourcesFileList; + protected ArrayList<String> resourcesFileList; - protected ArrayList rootFileList; + protected ArrayList<String> rootFileList; - protected ArrayList directoryList; + protected ArrayList<String> directoryList; - protected HashMap dataMap; + protected HashMap<String, String> dataMap; public MavenProjectBuildStub( String key ) throws Exception @@ -81,12 +81,12 @@ public class MavenProjectBuildStub super( key ); build = new Build(); - resourcesFileList = new ArrayList(); - sourceFileList = new ArrayList(); - rootFileList = new ArrayList(); - directoryList = new ArrayList(); - targetClassesList = new ArrayList(); - dataMap = new HashMap(); + resourcesFileList = new ArrayList<String>(); + sourceFileList = new ArrayList<String>(); + rootFileList = new ArrayList<String>(); + directoryList = new ArrayList<String>(); + targetClassesList = new ArrayList<String>(); + dataMap = new HashMap<String, String>(); setupBuild(); } @@ -108,7 +108,7 @@ public class MavenProjectBuildStub { if ( isValidPath( name ) ) { - List list = getList( type ); + List<String> list = getList( type ); list.add( name ); } @@ -242,9 +242,9 @@ public class MavenProjectBuildStub } } - private List getList( int type ) + private List<String> getList( int type ) { - ArrayList retVal = null; + ArrayList<String> retVal = null; switch ( type ) { @@ -268,7 +268,7 @@ public class MavenProjectBuildStub private void createFiles( String parent, int type ) { File currentFile; - ArrayList list = (ArrayList) getList( type ); + List<String> list = getList( type ); // guard if ( list == null ) Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ModelStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ModelStub.java?rev=1500733&r1=1500732&r2=1500733&view=diff ============================================================================== --- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ModelStub.java (original) +++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/ModelStub.java Mon Jul 8 13:56:05 2013 @@ -19,8 +19,6 @@ package org.apache.maven.plugin.resource * under the License. */ -import java.util.LinkedList; -import java.util.List; import java.util.Properties; import org.apache.maven.model.Model; @@ -32,6 +30,8 @@ import org.apache.maven.model.Parent; public class ModelStub extends Model { + private static final long serialVersionUID = 1L; + public ModelStub() { @@ -78,13 +78,4 @@ public class ModelStub return new Properties(); } - public List getPackages() - { - return new LinkedList(); - } - - public List getProfiles() - { - return new LinkedList(); - } }