From fac6b97faf3e7e16b31bf80ec4bb4000380a2e39 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 14 Feb 2009 21:49:23 +0000 Subject: [PATCH] o Generified model/project git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@744572 13f79535-47bb-0310-9956-ffa450edef68 --- maven-model/src/main/mdo/maven.mdo | 32 +- .../apache/maven/project/MavenProject.java | 294 +++++++++--------- pom.xml | 7 +- 3 files changed, 169 insertions(+), 164 deletions(-) diff --git a/maven-model/src/main/mdo/maven.mdo b/maven-model/src/main/mdo/maven.mdo index 9c628fdffc..59d4444206 100644 --- a/maven-model/src/main/mdo/maven.mdo +++ b/maven-model/src/main/mdo/maven.mdo @@ -743,7 +743,7 @@ 4.0.0 pluginMap; /** * Reset the pluginsMap field to null @@ -757,14 +757,14 @@ * @return a Map of plugins field with Plugins#getKey() as key * @see org.apache.maven.model.Plugin#getKey() */ - public synchronized java.util.Map getPluginsAsMap() + public synchronized java.util.Map getPluginsAsMap() { if ( pluginMap == null ) { - pluginMap = new java.util.LinkedHashMap(); + pluginMap = new java.util.LinkedHashMap(); if ( plugins != null ) { - for ( java.util.Iterator it = plugins.iterator(); it.hasNext(); ) + for ( java.util.Iterator it = plugins.iterator(); it.hasNext(); ) { Plugin plugin = (Plugin) it.next(); pluginMap.put( plugin.getKey(), plugin ); @@ -2621,7 +2621,7 @@ 4.0.0 executionMap = null; /** * Reset the executionMap field to null @@ -2635,14 +2635,14 @@ * @return a Map of executions field with PluginExecution#getId() as key * @see org.apache.maven.model.PluginExecution#getId() */ - public java.util.Map getExecutionsAsMap() + public java.util.Map getExecutionsAsMap() { if ( executionMap == null ) { - executionMap = new java.util.LinkedHashMap(); + executionMap = new java.util.LinkedHashMap(); if ( getExecutions() != null ) { - for ( java.util.Iterator i = getExecutions().iterator(); i.hasNext(); ) + for ( java.util.Iterator i = getExecutions().iterator(); i.hasNext(); ) { PluginExecution exec = (PluginExecution) i.next(); @@ -2832,7 +2832,7 @@ 4.0.0 reportPluginMap; /** * Reset the reportPluginMap field to null @@ -2846,14 +2846,14 @@ * @return a Map of plugins field with ReportPlugin#getKey() as key * @see org.apache.maven.model.ReportPlugin#getKey() */ - public synchronized java.util.Map getReportPluginsAsMap() + public synchronized java.util.Map getReportPluginsAsMap() { if ( reportPluginMap == null ) { - reportPluginMap = new java.util.LinkedHashMap(); + reportPluginMap = new java.util.LinkedHashMap(); if ( getPlugins() != null ) { - for ( java.util.Iterator it = getPlugins().iterator(); it.hasNext(); ) + for ( java.util.Iterator it = getPlugins().iterator(); it.hasNext(); ) { ReportPlugin reportPlugin = (ReportPlugin) it.next(); reportPluginMap.put( reportPlugin.getKey(), reportPlugin ); @@ -3179,7 +3179,7 @@ 4.0.0 reportSetMap = null; /** * Reset the reportSetMap field to null @@ -3193,14 +3193,14 @@ * @return a Map of reportSets field with ReportSet#getId() as key * @see org.apache.maven.model.ReportSet#getId() */ - public java.util.Map getReportSetsAsMap() + public java.util.Map getReportSetsAsMap() { if ( reportSetMap == null ) { - reportSetMap = new java.util.LinkedHashMap(); + reportSetMap = new java.util.LinkedHashMap(); if ( getReportSets() != null ) { - for ( java.util.Iterator i = getReportSets().iterator(); i.hasNext(); ) + for ( java.util.Iterator i = getReportSets().iterator(); i.hasNext(); ) { ReportSet reportSet = (ReportSet) i.next(); reportSetMap.put( reportSet.getId(), reportSet ); diff --git a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java index f967df0ab3..9705d061c6 100644 --- a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java @@ -64,9 +64,11 @@ import org.apache.maven.model.Parent; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginManagement; import org.apache.maven.model.Prerequisites; +import org.apache.maven.model.Profile; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.ReportSet; import org.apache.maven.model.Reporting; +import org.apache.maven.model.Repository; import org.apache.maven.model.Resource; import org.apache.maven.model.Scm; import org.apache.maven.model.io.xpp3.MavenXpp3Writer; @@ -104,7 +106,7 @@ public class MavenProject private File file; - private Set artifacts; + private Set artifacts; private Artifact parentArtifact; @@ -112,54 +114,54 @@ public class MavenProject private List remoteArtifactRepositories; - private List collectedProjects = Collections.EMPTY_LIST; + private List collectedProjects = Collections.emptyList(); private List attachedArtifacts; private MavenProject executionProject; - private List compileSourceRoots = new ArrayList(); + private List compileSourceRoots = new ArrayList(); - private List testCompileSourceRoots = new ArrayList(); + private List testCompileSourceRoots = new ArrayList(); - private List scriptSourceRoots = new ArrayList(); + private List scriptSourceRoots = new ArrayList(); - private List pluginArtifactRepositories; + private List pluginArtifactRepositories; private ArtifactRepository releaseArtifactRepository; private ArtifactRepository snapshotArtifactRepository; - private List activeProfiles = new ArrayList(); + private List activeProfiles = new ArrayList(); - private Set dependencyArtifacts; + private Set dependencyArtifacts; private Artifact artifact; // calculated. - private Map artifactMap; + private Map artifactMap; private Model originalModel; - private Map pluginArtifactMap; + private Map pluginArtifactMap; - private Set reportArtifacts; + private Set reportArtifacts; - private Map reportArtifactMap; + private Map reportArtifactMap; - private Set extensionArtifacts; + private Set extensionArtifacts; - private Map extensionArtifactMap; + private Map extensionArtifactMap; - private Map managedVersionMap; + private Map managedVersionMap; - private Map projectReferences = new HashMap(); + private Map projectReferences = new HashMap(); private boolean executionRoot; - private Map moduleAdjustments; + private Map moduleAdjustments; - private Stack previousExecutionProjects = new Stack(); + private Stack previousExecutionProjects = new Stack(); //!! Components that need to be taken out of here private ArtifactFactory artifactFactory; @@ -250,7 +252,7 @@ public class MavenProject try { - LinkedHashSet repoSet = new LinkedHashSet(); + Set repoSet = new LinkedHashSet(); if ( ( model.getRepositories() != null ) && !model.getRepositories().isEmpty() ) { repoSet.addAll( model.getRepositories() ); @@ -261,7 +263,7 @@ public class MavenProject repoSet.addAll( model.getPluginRepositories() ); } - setRemoteArtifactRepositories( mavenTools.buildArtifactRepositories( new ArrayList( repoSet ) ) ); + setRemoteArtifactRepositories( mavenTools.buildArtifactRepositories( new ArrayList( repoSet ) ) ); } catch ( Exception e ) { @@ -298,12 +300,12 @@ public class MavenProject if ( moduleAdjustments == null ) { - moduleAdjustments = new HashMap(); + moduleAdjustments = new HashMap(); - List modules = getModules(); + List modules = getModules(); if ( modules != null ) { - for ( Iterator it = modules.iterator(); it.hasNext(); ) + for ( Iterator it = modules.iterator(); it.hasNext(); ) { String modulePath = (String) it.next(); String moduleName = modulePath; @@ -403,7 +405,7 @@ public class MavenProject this.parent = parent; } - public void setRemoteArtifactRepositories( List remoteArtifactRepositories ) + public void setRemoteArtifactRepositories( List remoteArtifactRepositories ) { this.remoteArtifactRepositories = remoteArtifactRepositories; } @@ -441,12 +443,12 @@ public class MavenProject } } - public void setDependencies( List dependencies ) + public void setDependencies( List dependencies ) { getModel().setDependencies( dependencies ); } - public List getDependencies() + public List getDependencies() { return getModel().getDependencies(); } @@ -505,29 +507,29 @@ public class MavenProject } } - public List getCompileSourceRoots() + public List getCompileSourceRoots() { return compileSourceRoots; } - public List getScriptSourceRoots() + public List getScriptSourceRoots() { return scriptSourceRoots; } - public List getTestCompileSourceRoots() + public List getTestCompileSourceRoots() { return testCompileSourceRoots; } - public List getCompileClasspathElements() + public List getCompileClasspathElements() throws DependencyResolutionRequiredException { - List list = new ArrayList( getArtifacts().size() ); + List list = new ArrayList( getArtifacts().size() + 1 ); list.add( getBuild().getOutputDirectory() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -544,11 +546,11 @@ public class MavenProject return list; } - public List getCompileArtifacts() + public List getCompileArtifacts() { - List list = new ArrayList( getArtifacts().size() ); + List list = new ArrayList( getArtifacts().size() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -566,18 +568,18 @@ public class MavenProject return list; } - public List getCompileDependencies() + public List getCompileDependencies() { - Set artifacts = getArtifacts(); + Set artifacts = getArtifacts(); if ( ( artifacts == null ) || artifacts.isEmpty() ) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } - List list = new ArrayList( artifacts.size() ); + List list = new ArrayList( artifacts.size() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -600,16 +602,16 @@ public class MavenProject return list; } - public List getTestClasspathElements() + public List getTestClasspathElements() throws DependencyResolutionRequiredException { - List list = new ArrayList( getArtifacts().size() + 2 ); + List list = new ArrayList( getArtifacts().size() + 2 ); list.add( getBuild().getTestOutputDirectory() ); list.add( getBuild().getOutputDirectory() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -626,11 +628,11 @@ public class MavenProject return list; } - public List getTestArtifacts() + public List getTestArtifacts() { - List list = new ArrayList( getArtifacts().size() ); + List list = new ArrayList( getArtifacts().size() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -643,18 +645,18 @@ public class MavenProject return list; } - public List getTestDependencies() + public List getTestDependencies() { - Set artifacts = getArtifacts(); + Set artifacts = getArtifacts(); if ( ( artifacts == null ) || artifacts.isEmpty() ) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } - List list = new ArrayList( artifacts.size() ); + List list = new ArrayList( artifacts.size() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -672,14 +674,14 @@ public class MavenProject return list; } - public List getRuntimeClasspathElements() + public List getRuntimeClasspathElements() throws DependencyResolutionRequiredException { - List list = new ArrayList( getArtifacts().size() + 1 ); + List list = new ArrayList( getArtifacts().size() + 1 ); list.add( getBuild().getOutputDirectory() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -700,11 +702,11 @@ public class MavenProject return list; } - public List getRuntimeArtifacts() + public List getRuntimeArtifacts() { - List list = new ArrayList( getArtifacts().size() ); + List list = new ArrayList( getArtifacts().size() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -721,18 +723,18 @@ public class MavenProject return list; } - public List getRuntimeDependencies() + public List getRuntimeDependencies() { - Set artifacts = getArtifacts(); + Set artifacts = getArtifacts(); if ( ( artifacts == null ) || artifacts.isEmpty() ) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } - List list = new ArrayList( artifacts.size() ); + List list = new ArrayList( artifacts.size() ); - for ( Iterator i = artifacts.iterator(); i.hasNext(); ) + for ( Iterator i = artifacts.iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -754,14 +756,14 @@ public class MavenProject return list; } - public List getSystemClasspathElements() + public List getSystemClasspathElements() throws DependencyResolutionRequiredException { - List list = new ArrayList( getArtifacts().size() ); + List list = new ArrayList( getArtifacts().size() ); list.add( getBuild().getOutputDirectory() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -777,11 +779,11 @@ public class MavenProject return list; } - public List getSystemArtifacts() + public List getSystemArtifacts() { - List list = new ArrayList( getArtifacts().size() ); + List list = new ArrayList( getArtifacts().size() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -798,18 +800,18 @@ public class MavenProject return list; } - public List getSystemDependencies() + public List getSystemDependencies() { - Set artifacts = getArtifacts(); + Set artifacts = getArtifacts(); if ( ( artifacts == null ) || artifacts.isEmpty() ) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } - List list = new ArrayList( artifacts.size() ); + List list = new ArrayList( artifacts.size() ); - for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) + for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); @@ -1007,12 +1009,12 @@ public class MavenProject return getModel().getScm(); } - public void setMailingLists( List mailingLists ) + public void setMailingLists( List mailingLists ) { getModel().setMailingLists( mailingLists ); } - public List getMailingLists() + public List getMailingLists() { return getModel().getMailingLists(); } @@ -1022,12 +1024,12 @@ public class MavenProject getModel().addMailingList( mailingList ); } - public void setDevelopers( List developers ) + public void setDevelopers( List developers ) { getModel().setDevelopers( developers ); } - public List getDevelopers() + public List getDevelopers() { return getModel().getDevelopers(); } @@ -1037,12 +1039,12 @@ public class MavenProject getModel().addDeveloper( developer ); } - public void setContributors( List contributors ) + public void setContributors( List contributors ) { getModel().setContributors( contributors ); } - public List getContributors() + public List getContributors() { return getModel().getContributors(); } @@ -1062,12 +1064,12 @@ public class MavenProject return getModelBuild(); } - public List getResources() + public List getResources() { return getBuild().getResources(); } - public List getTestResources() + public List getTestResources() { return getBuild().getTestResources(); } @@ -1092,12 +1094,12 @@ public class MavenProject return getModel().getReporting(); } - public void setLicenses( List licenses ) + public void setLicenses( List licenses ) { getModel().setLicenses( licenses ); } - public List getLicenses() + public List getLicenses() { return getModel().getLicenses(); } @@ -1107,7 +1109,7 @@ public class MavenProject getModel().addLicense( license ); } - public void setArtifacts( Set artifacts ) + public void setArtifacts( Set artifacts ) { this.artifacts = artifacts; @@ -1123,12 +1125,12 @@ public class MavenProject * @return {@link Set} < {@link Artifact} > * @see #getDependencyArtifacts() to get only direct dependencies */ - public Set getArtifacts() + public Set getArtifacts() { - return artifacts == null ? Collections.EMPTY_SET : artifacts; + return artifacts == null ? Collections. emptySet() : artifacts; } - public Map getArtifactMap() + public Map getArtifactMap() { if ( artifactMap == null ) { @@ -1137,17 +1139,17 @@ public class MavenProject return artifactMap; } - public Set getPluginArtifacts() + public Set getPluginArtifacts() { if ( pluginArtifacts != null ) { return pluginArtifacts; } - pluginArtifacts = new HashSet(); + pluginArtifacts = new HashSet(); if ( artifactFactory != null ) { - List plugins = getBuildPlugins(); - for ( Iterator i = plugins.iterator(); i.hasNext(); ) + List plugins = getBuildPlugins(); + for ( Iterator i = plugins.iterator(); i.hasNext(); ) { Plugin p = (Plugin) i.next(); @@ -1182,31 +1184,31 @@ public class MavenProject return pluginArtifacts; } - public Map getPluginArtifactMap() + public Map getPluginArtifactMap() { pluginArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getPluginArtifacts() ); return pluginArtifactMap; } - public void setReportArtifacts( Set reportArtifacts ) + public void setReportArtifacts( Set reportArtifacts ) { this.reportArtifacts = reportArtifacts; reportArtifactMap = null; } - public Set getReportArtifacts() + public Set getReportArtifacts() { if( reportArtifacts != null ) { return reportArtifacts; } - reportArtifacts = new HashSet(); - List reports = getReportPlugins(); + reportArtifacts = new HashSet(); + List reports = getReportPlugins(); if ( reports != null ) { - for ( Iterator i = reports.iterator(); i.hasNext(); ) + for ( Iterator i = reports.iterator(); i.hasNext(); ) { ReportPlugin p = (ReportPlugin) i.next(); @@ -1241,7 +1243,7 @@ public class MavenProject return reportArtifacts; } - public Map getReportArtifactMap() + public Map getReportArtifactMap() { if ( reportArtifactMap == null ) { @@ -1251,24 +1253,24 @@ public class MavenProject return reportArtifactMap; } - public void setExtensionArtifacts( Set extensionArtifacts ) + public void setExtensionArtifacts( Set extensionArtifacts ) { this.extensionArtifacts = extensionArtifacts; extensionArtifactMap = null; } - public Set getExtensionArtifacts() + public Set getExtensionArtifacts() { if( extensionArtifacts != null ) { return extensionArtifacts; } - extensionArtifacts = new HashSet(); - List extensions = getBuildExtensions(); + extensionArtifacts = new HashSet(); + List extensions = getBuildExtensions(); if ( extensions != null ) { - for ( Iterator i = extensions.iterator(); i.hasNext(); ) + for ( Iterator i = extensions.iterator(); i.hasNext(); ) { Extension ext = (Extension) i.next(); @@ -1304,7 +1306,7 @@ public class MavenProject return extensionArtifacts; } - public Map getExtensionArtifactMap() + public Map getExtensionArtifactMap() { if ( extensionArtifactMap == null ) { @@ -1329,7 +1331,7 @@ public class MavenProject return parentArtifact; } - public List getRepositories() + public List getRepositories() { return getModel().getRepositories(); } @@ -1338,26 +1340,26 @@ public class MavenProject // Plugins // ---------------------------------------------------------------------- - public List getReportPlugins() + public List getReportPlugins() { if ( getModel().getReporting() == null ) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } return getModel().getReporting().getPlugins(); } - public List getBuildPlugins() + public List getBuildPlugins() { if ( getModel().getBuild() == null ) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } return getModel().getBuild().getPlugins(); } - public List getModules() + public List getModules() { return getModel().getModules(); } @@ -1409,7 +1411,7 @@ public class MavenProject if ( pm != null ) { - Map pmByKey = pm.getPluginsAsMap(); + Map pmByKey = pm.getPluginsAsMap(); String pluginKey = plugin.getKey(); @@ -1422,17 +1424,17 @@ public class MavenProject } } - public List getCollectedProjects() + public List getCollectedProjects() { return collectedProjects; } - public void setCollectedProjects( List collectedProjects ) + public void setCollectedProjects( List collectedProjects ) { this.collectedProjects = collectedProjects; } - public void setPluginArtifactRepositories( List pluginArtifactRepositories ) + public void setPluginArtifactRepositories( List pluginArtifactRepositories ) { this.pluginArtifactRepositories = pluginArtifactRepositories; } @@ -1441,7 +1443,7 @@ public class MavenProject * @return a list of ArtifactRepository objects constructed * from the Repository objects returned by getPluginRepositories. */ - public List getPluginArtifactRepositories() + public List getPluginArtifactRepositories() { return getRemoteArtifactRepositories(); } @@ -1453,18 +1455,18 @@ public class MavenProject : getReleaseArtifactRepository(); } - public List getPluginRepositories() + public List getPluginRepositories() { // return model.getPluginRepositories(); return getModel().getRepositories(); } - public void setActiveProfiles( List activeProfiles ) + public void setActiveProfiles( List activeProfiles ) { this.activeProfiles.addAll( activeProfiles ); } - public List getActiveProfiles() + public List getActiveProfiles() { return activeProfiles; } @@ -1472,7 +1474,7 @@ public class MavenProject public void addAttachedArtifact( Artifact artifact ) throws DuplicateArtifactAttachmentException { - List attachedArtifacts = getAttachedArtifacts(); + List attachedArtifacts = getAttachedArtifacts(); if ( attachedArtifacts.contains( artifact ) ) { @@ -1507,7 +1509,7 @@ public class MavenProject if ( getReportPlugins() != null ) { - for ( Iterator iterator = getReportPlugins().iterator(); iterator.hasNext(); ) + for ( Iterator iterator = getReportPlugins().iterator(); iterator.hasNext(); ) { ReportPlugin plugin = (ReportPlugin) iterator.next(); @@ -1563,12 +1565,12 @@ public class MavenProject * @return {@link Set} < {@link Artifact} > * @see #getArtifacts() to get all transitive dependencies */ - public Set getDependencyArtifacts() + public Set getDependencyArtifacts() { return dependencyArtifacts; } - public void setDependencyArtifacts( Set dependencyArtifacts ) + public void setDependencyArtifacts( Set dependencyArtifacts ) { this.dependencyArtifacts = dependencyArtifacts; } @@ -1593,29 +1595,29 @@ public class MavenProject return originalModel; } - public void setManagedVersionMap( Map map ) + public void setManagedVersionMap( Map map ) { managedVersionMap = map; } - public Map getManagedVersionMap() + public Map getManagedVersionMap() { if ( managedVersionMap != null ) { return managedVersionMap; } - Map map = null; + Map map = null; if ( artifactFactory != null ) { - List deps; + List deps; DependencyManagement dependencyManagement = getDependencyManagement(); if ( ( dependencyManagement != null ) && ( ( deps = dependencyManagement.getDependencies() ) != null ) && ( deps.size() > 0 ) ) { map = new ManagedVersionMap( map ); - for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); ) + for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); ) { Dependency d = (Dependency) i.next(); @@ -1639,9 +1641,9 @@ public class MavenProject if ( ( null != d.getExclusions() ) && !d.getExclusions().isEmpty() ) { - List exclusions = new ArrayList(); + List exclusions = new ArrayList(); - for ( Iterator j = d.getExclusions().iterator(); j.hasNext(); ) + for ( Iterator j = d.getExclusions().iterator(); j.hasNext(); ) { Exclusion e = (Exclusion) j.next(); @@ -1661,13 +1663,13 @@ public class MavenProject } catch ( InvalidVersionSpecificationException e ) { - map = Collections.EMPTY_MAP; + map = Collections.emptyMap(); } } } else if ( map == null ) { - map = Collections.EMPTY_MAP; + map = Collections.emptyMap(); } } managedVersionMap = map; @@ -1699,12 +1701,12 @@ public class MavenProject return getId().hashCode(); } - public List getBuildExtensions() + public List getBuildExtensions() { Build build = getBuild(); if ( ( build == null ) || ( build.getExtensions() == null ) ) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } else { @@ -1716,7 +1718,7 @@ public class MavenProject * @return {@link Set} < {@link Artifact} > * @todo the lazy initialisation of this makes me uneasy. */ - public Set createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, + public Set createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter dependencyFilter ) throws InvalidDependencyVersionException { @@ -1743,12 +1745,12 @@ public class MavenProject return getModel().getProperties(); } - public List getFilters() + public List getFilters() { return getBuild().getFilters(); } - public Map getProjectReferences() + public Map getProjectReferences() { return projectReferences; } @@ -1796,7 +1798,7 @@ public class MavenProject } } - Iterator itr = ref.getAttachedArtifacts().iterator(); + Iterator itr = ref.getAttachedArtifacts().iterator(); while ( itr.hasNext() ) { Artifact attached = (Artifact) itr.next(); @@ -1904,22 +1906,22 @@ public class MavenProject this.model = model; } - protected void setAttachedArtifacts( List attachedArtifacts ) + protected void setAttachedArtifacts( List attachedArtifacts ) { this.attachedArtifacts = attachedArtifacts; } - protected void setCompileSourceRoots( List compileSourceRoots ) + protected void setCompileSourceRoots( List compileSourceRoots ) { this.compileSourceRoots = compileSourceRoots; } - protected void setTestCompileSourceRoots( List testCompileSourceRoots ) + protected void setTestCompileSourceRoots( List testCompileSourceRoots ) { this.testCompileSourceRoots = testCompileSourceRoots; } - protected void setScriptSourceRoots( List scriptSourceRoots ) + protected void setScriptSourceRoots( List scriptSourceRoots ) { this.scriptSourceRoots = scriptSourceRoots; } @@ -1994,23 +1996,23 @@ public class MavenProject if ( project.getAttachedArtifacts() != null ) { // clone properties modifyable by plugins in a forked lifecycle - setAttachedArtifacts( new ArrayList( project.getAttachedArtifacts() ) ); + setAttachedArtifacts( new ArrayList( project.getAttachedArtifacts() ) ); } if ( project.getCompileSourceRoots() != null ) { // clone source roots - setCompileSourceRoots( ( new ArrayList( project.getCompileSourceRoots() ) ) ); + setCompileSourceRoots( ( new ArrayList( project.getCompileSourceRoots() ) ) ); } if ( project.getTestCompileSourceRoots() != null ) { - setTestCompileSourceRoots( ( new ArrayList( project.getTestCompileSourceRoots() ) ) ); + setTestCompileSourceRoots( ( new ArrayList( project.getTestCompileSourceRoots() ) ) ); } if ( project.getScriptSourceRoots() != null ) { - setScriptSourceRoots( ( new ArrayList( project.getScriptSourceRoots() ) ) ); + setScriptSourceRoots( ( new ArrayList( project.getScriptSourceRoots() ) ) ); } setModel( project.getModel() ); @@ -2043,7 +2045,7 @@ public class MavenProject } } - private void addArtifactPath( Artifact a, List list ) + private void addArtifactPath( Artifact a, List list ) throws DependencyResolutionRequiredException { String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId(), a.getVersion() ); diff --git a/pom.xml b/pom.xml index 65893aa70a..f493f7695d 100644 --- a/pom.xml +++ b/pom.xml @@ -185,6 +185,9 @@ under the License. org.codehaus.modello modello-maven-plugin ${modelloVersion} + + true + site-docs @@ -413,8 +416,8 @@ under the License. - commons-jxpath - commons-jxpath + commons-jxpath + commons-jxpath ${jxpathVersion}