+ * This builder uses a number of threads equal to the minimum of the degree of concurrency (which is the thread count
+ * set with -T on the command-line) and the number of projects to build. As such, building a single project
+ * will always result in a sequential build, regardless of the thread count.
*
* @since 3.0
* @author Kristian Rosenvold
@@ -73,9 +77,15 @@ public void build( MavenSession session, ReactorContext reactorContext, ProjectB
List taskSegments, ReactorBuildStatus reactorBuildStatus )
throws ExecutionException, InterruptedException
{
- ExecutorService executor =
- Executors.newFixedThreadPool( Math.min( session.getRequest().getDegreeOfConcurrency(),
- session.getProjects().size() ), new BuildThreadFactory() );
+ int nThreads = Math.min( session.getRequest().getDegreeOfConcurrency(), session.getProjects().size() );
+ boolean parallel = nThreads >= 2;
+ // Propagate the parallel flag to the root session and all of the cloned sessions in each project segment
+ session.setParallel( parallel );
+ for ( ProjectSegment segment : projectBuilds )
+ {
+ segment.getSession().setParallel( parallel );
+ }
+ ExecutorService executor = Executors.newFixedThreadPool( nThreads, new BuildThreadFactory() );
CompletionService service = new ExecutorCompletionService<>( executor );
ConcurrencyDependencyGraph analyzer =
new ConcurrencyDependencyGraph( projectBuilds, session.getProjectDependencyGraph() );
@@ -150,7 +160,7 @@ private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph an
}
catch ( ExecutionException e )
{
- // TODO MNG-5766 changes likely made this redundant
+ // TODO MNG-5766 changes likely made this redundant
rootSession.getResult().addException( e );
break;
}
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java
index e6845a36e3b6..e33b9b2cfc0a 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java
@@ -107,7 +107,7 @@ else if ( "default".equals( lifecycle ) )
return null;
}
}
-
+
@Deprecated
public Map getPhases( String lifecycle )
{
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java
index ad3e486eb1bf..afc82ae10077 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java
@@ -62,7 +62,7 @@ public Map getLifecyclePhases()
{
return this.lifecyclePhases;
}
-
+
/**
* Method setId
*
@@ -89,12 +89,12 @@ public Map getPhases()
{
return null;
}
-
+
if ( lphases.isEmpty() )
{
return Collections.emptyMap();
}
-
+
Map phases = new LinkedHashMap<>();
for ( Map.Entry e: lphases.entrySet() )
{
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java
index f2af879516c2..8d8fc18066dd 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMojo.java
@@ -26,36 +26,36 @@
public class LifecycleMojo
{
-
+
private String goal;
private Xpp3Dom configuration;
private List dependencies;
-
+
public String getGoal()
{
return goal;
}
-
+
public Xpp3Dom getConfiguration()
{
return configuration;
}
-
+
public List getDependencies()
{
return dependencies;
}
-
+
public void setGoal( String goal )
{
this.goal = goal;
}
-
+
public void setConfiguration( Xpp3Dom configuration )
{
this.configuration = configuration;
}
-
+
public void setDependencies( List dependencies )
{
this.dependencies = dependencies;
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
index 295e6421d4d7..963c3b14b749 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
@@ -29,36 +29,36 @@
public class LifecyclePhase
{
-
+
private List mojos;
-
+
public LifecyclePhase()
{
}
-
+
public LifecyclePhase( String goals )
{
set( goals );
}
-
+
public List getMojos()
{
return mojos;
}
-
+
public void setMojos( List mojos )
{
this.mojos = mojos;
}
-
+
public void set( String goals )
{
mojos = new ArrayList<>();
-
+
if ( StringUtils.isNotEmpty( goals ) )
{
String[] mojoGoals = StringUtils.split( goals, "," );
-
+
for ( String mojoGoal: mojoGoals )
{
LifecycleMojo lifecycleMojo = new LifecycleMojo();
@@ -67,7 +67,7 @@ public void set( String goals )
}
}
}
-
+
@Override
public String toString()
{
@@ -91,7 +91,7 @@ public String toString()
}
return sb.toString();
}
-
+
@Deprecated
public static Map toLegacyMap( Map lifecyclePhases )
{
@@ -99,12 +99,12 @@ public static Map toLegacyMap( Map lifec
{
return null;
}
-
+
if ( lifecyclePhases.isEmpty() )
{
return Collections.emptyMap();
}
-
+
Map phases = new LinkedHashMap<>();
for ( Map.Entry e: lifecyclePhases.entrySet() )
{
@@ -112,5 +112,5 @@ public static Map toLegacyMap( Map lifec
}
return phases;
}
-
+
}
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java
index 1eaa627e741e..78a1765b16f4 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultProjectArtifactsCache.java
@@ -54,11 +54,11 @@ protected static class CacheKey
{
private final String groupId;
-
+
private final String artifactId;
-
+
private final String version;
-
+
private final Set dependencyArtifacts;
private final WorkspaceRepository workspace;
@@ -66,11 +66,11 @@ protected static class CacheKey
private final LocalRepository localRepo;
private final List repositories;
-
+
private final Set collect;
-
+
private final Set resolve;
-
+
private boolean aggregating;
private final int hashCode;
@@ -79,11 +79,11 @@ public CacheKey( MavenProject project, List repositories,
Collection scopesToCollect, Collection scopesToResolve, boolean aggregating,
RepositorySystemSession session )
{
-
+
groupId = project.getGroupId();
artifactId = project.getArtifactId();
version = project.getVersion();
-
+
Set deps = new HashSet<>();
if ( project.getDependencyArtifacts() != null )
{
@@ -93,7 +93,7 @@ public CacheKey( MavenProject project, List repositories,
}
}
dependencyArtifacts = Collections.unmodifiableSet( deps );
-
+
workspace = CacheUtils.getWorkspace( session );
this.localRepo = session.getLocalRepository();
this.repositories = new ArrayList<>( repositories.size() );
@@ -109,10 +109,10 @@ public CacheKey( MavenProject project, List repositories,
}
}
collect = scopesToCollect == null
- ? Collections.emptySet()
+ ? Collections.emptySet()
: Collections.unmodifiableSet( new HashSet<>( scopesToCollect ) );
- resolve = scopesToResolve == null
- ? Collections.emptySet()
+ resolve = scopesToResolve == null
+ ? Collections.emptySet()
: Collections.unmodifiableSet( new HashSet<>( scopesToResolve ) );
this.aggregating = aggregating;
@@ -162,10 +162,10 @@ public boolean equals( Object o )
CacheKey that = (CacheKey) o;
- return eq( groupId, that.groupId ) && eq( artifactId, that.artifactId ) && eq( version, that.version )
+ return eq( groupId, that.groupId ) && eq( artifactId, that.artifactId ) && eq( version, that.version )
&& eq( dependencyArtifacts, that.dependencyArtifacts )
- && eq( workspace, that.workspace ) && eq( localRepo, that.localRepo )
- && CacheUtils.repositoriesEquals( repositories, that.repositories ) && eq( collect, that.collect )
+ && eq( workspace, that.workspace ) && eq( localRepo, that.localRepo )
+ && CacheUtils.repositoriesEquals( repositories, that.repositories ) && eq( collect, that.collect )
&& eq( resolve, that.resolve ) && aggregating == that.aggregating;
}
@@ -181,7 +181,7 @@ private static boolean eq( T s1, T s2 )
public Key createKey( MavenProject project, Collection scopesToCollect,
Collection scopesToResolve, boolean aggregating, RepositorySystemSession session )
{
- return new CacheKey( project, project.getRemoteProjectRepositories(), scopesToCollect, scopesToResolve,
+ return new CacheKey( project, project.getRemoteProjectRepositories(), scopesToCollect, scopesToResolve,
aggregating, session );
}
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java
index b228a1b4b7cf..c1ef63e7f4c5 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java
@@ -95,7 +95,7 @@ void setupPluginRealm( PluginDescriptor pluginDescriptor, MavenSession session,
/**
* Sets up class realm for the specified build extensions plugin.
- *
+ *
* @since 3.3.0
*/
ExtensionRealmCache.CacheRecord setupExtensionsRealm( MavenProject project, Plugin plugin,
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
index a7eeb4e307c0..558908dbe839 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
@@ -52,7 +52,7 @@
*
settings
{@link MavenSession#getSettings()}
*
settings.*
*
basedir
- *
{@link MavenSession#getExecutionRootDirectory()} or
+ *
{@link MavenSession#getExecutionRootDirectory()} or
* System.getProperty( "user.dir" ) if null
*
mojoExecution
the actual {@link MojoExecution}
*
mojo
(since Maven 3)
same as mojoExecution
@@ -104,12 +104,12 @@ public PluginParameterExpressionEvaluator( MavenSession session, MojoExecution m
this.project = session.getCurrentProject();
//
- // Maven4: We may want to evaluate how this is used but we add these separate as the
+ // Maven4: We may want to evaluate how this is used but we add these separate as the
// getExecutionProperties is deprecated in MavenSession.
//
this.properties.putAll( session.getUserProperties() );
this.properties.putAll( session.getSystemProperties() );
-
+
String basedir = null;
if ( project != null )
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java
index 42a95e509b07..2e564bad1ace 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/ProjectArtifactsCache.java
@@ -66,7 +66,7 @@ public CacheRecord( LifecycleExecutionException exception )
}
}
- Key createKey( MavenProject project, Collection scopesToCollect, Collection scopesToResolve,
+ Key createKey( MavenProject project, Collection scopesToCollect, Collection scopesToResolve,
boolean aggregating, RepositorySystemSession session );
CacheRecord get( Key key ) throws LifecycleExecutionException;
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
index f11ee956a34e..2275b7af6576 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
@@ -87,8 +87,6 @@ public class DefaultPluginVersionResolver
public PluginVersionResult resolve( PluginVersionRequest request )
throws PluginVersionResolutionException
{
- logger.debug( "Resolving plugin version for " + request.getGroupId() + ":" + request.getArtifactId() );
-
PluginVersionResult result = resolveFromProject( request );
if ( result == null )
@@ -103,8 +101,8 @@ public PluginVersionResult resolve( PluginVersionRequest request )
}
else if ( logger.isDebugEnabled() )
{
- logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId()
- + " to " + result.getVersion() + " from POM " + request.getPom() );
+ logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId() + " to "
+ + result.getVersion() + " from POM " + request.getPom() );
}
return result;
@@ -156,6 +154,7 @@ private void selectVersion( DefaultPluginVersionResult result, PluginVersionRequ
String version = null;
ArtifactRepository repo = null;
+ logger.info( "selectVersion:" + request.getGroupId() );
if ( StringUtils.isNotEmpty( versions.releaseVersion ) )
{
version = versions.releaseVersion;
@@ -351,6 +350,7 @@ private PluginVersionResult resolveFromProject( PluginVersionRequest request )
{
PluginVersionResult result = null;
+ logger.info( "resolveFromProject:" + request.getGroupId() );
if ( request.getPom() != null && request.getPom().getBuild() != null )
{
Build build = request.getPom().getBuild();
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
index 2406ff90e1ba..25124e42d1a8 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
@@ -895,7 +895,7 @@ class InternalConfig
public final List repositories;
public final ReactorModelPool modelPool;
-
+
public final ReactorModelCache modelCache;
InternalConfig( ProjectBuildingRequest request, ReactorModelPool modelPool, ReactorModelCache modelCache )
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
index 97eb2762c552..dafbefd3700a 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
@@ -28,6 +28,7 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Profile;
import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.properties.internal.SystemProperties;
import org.eclipse.aether.RepositorySystemSession;
public class DefaultProjectBuildingRequest
@@ -166,11 +167,7 @@ public ProjectBuildingRequest setSystemProperties( Properties systemProperties )
{
if ( systemProperties != null )
{
- this.systemProperties = new Properties();
- synchronized ( systemProperties )
- { // avoid concurrentmodification if someone else sets/removes an unrelated system property
- this.systemProperties.putAll( systemProperties );
- }
+ this.systemProperties = SystemProperties.copyProperties( systemProperties );
}
else
{
diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
index d7d6ce8e8553..3e31c7cc1378 100644
--- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
+++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
@@ -260,7 +260,7 @@ public void setFile( File file )
/**
* Sets project {@code file} without changing project {@code basedir}.
- *
+ *
* @since 3.2.4
*/
public void setPomFile( File file )
diff --git a/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java b/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java
index 679ee008856e..1b297336c4ad 100644
--- a/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java
+++ b/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java
@@ -23,7 +23,7 @@
/**
* Component interface that allows per-project customization of Aether repository system sessions.
- *
+ *
* @since 3.2.4
* @provisional This interface is part of work in progress and can be changed or removed without notice.
*/
diff --git a/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java b/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java
index 037255819862..16cf82808055 100644
--- a/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java
+++ b/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java
@@ -33,19 +33,33 @@ public class SystemProperties
*/
public static void addSystemProperties( Properties props )
{
- for ( String key : System.getProperties().stringPropertyNames() )
- {
- props.put( key, System.getProperty( key ) );
- }
+ props.putAll( getSystemProperties() );
}
/**
- * Returns System.properties copy.
+ * Returns a copy of {@link System#getProperties()} in a thread-safe manner.
+ *
+ * @return {@link System#getProperties()} obtained in a thread-safe manner.
*/
public static Properties getSystemProperties()
{
- Properties systemProperties = new Properties();
- addSystemProperties( systemProperties );
- return systemProperties;
+ return copyProperties( System.getProperties() );
}
+
+ /**
+ * Copies the given {@link Properties} object into a new {@link Properties} object, in a thread-safe manner.
+ * @param properties Properties to copy.
+ * @return Copy of the given properties.
+ */
+ public static Properties copyProperties( Properties properties )
+ {
+ final Properties copyProperties = new Properties();
+ // guard against modification/removal of keys in the given properties (MNG-5670, MNG-6053, MNG-6105)
+ synchronized ( properties )
+ {
+ copyProperties.putAll( properties );
+ }
+ return copyProperties;
+ }
+
}
diff --git a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java
index 5766b9886ce6..fcc0f7770c4d 100644
--- a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java
+++ b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java
@@ -50,18 +50,8 @@ public interface RepositorySystem
File defaultUserLocalRepository = new File( userMavenConfigurationHome, "repository" );
- /**
- * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
- * {@code central} if such a repository is not provided in the settings or the POM.
- */
- @Deprecated
String DEFAULT_REMOTE_REPO_ID = "central";
- /**
- * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
- * {@code central} if such a repository is not provided in the settings or the POM.
- */
- @Deprecated
String DEFAULT_REMOTE_REPO_URL = "https://repo.maven.apache.org/maven2";
Artifact createArtifact( String groupId, String artifactId, String version, String packaging );
@@ -80,11 +70,6 @@ Artifact createArtifactWithClassifier( String groupId, String artifactId, String
ArtifactRepository buildArtifactRepository( Repository repository )
throws InvalidRepositoryException;
- /**
- * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
- * {@code central} if such a repository is not provided in the settings or the POM.
- */
- @Deprecated
ArtifactRepository createDefaultRemoteRepository()
throws InvalidRepositoryException;
diff --git a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
index 820d886e29b9..ec499cabfe9f 100644
--- a/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java
@@ -66,7 +66,7 @@ public Settings buildSettings( File userSettingsFile )
throws IOException, XmlPullParserException
{
File globalSettingsFile =
- getFile( "${maven.home}/conf/settings.xml", "maven.home",
+ getFile( "${maven.conf}/settings.xml", "maven.home",
MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION );
SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java
index 59f5e13fbb98..8e5359dbb1d8 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java
@@ -49,7 +49,7 @@ public abstract class DefaultToolchain // should have been AbstractToolchain...
private Logger logger;
/**
- *
+ *
* @param model the model, must not be {@code null}
* @param logger the logger, must not be {@code null}
*/
@@ -61,7 +61,7 @@ protected DefaultToolchain( ToolchainModel model, Logger logger )
}
/**
- *
+ *
* @param model the model, must not be {@code null}
* @param type the type
* @param logger the logger, must not be {@code null}
@@ -164,7 +164,7 @@ public int hashCode()
}
return hashCode;
}
-
+
@Override
public String toString()
{
@@ -182,9 +182,9 @@ public String toString()
builder.append( ';' );
}
}
-
+
builder.append( '}' );
-
+
return builder.toString();
}
}
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
index 9f7a26b4ed6b..e36f9b0c7558 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
@@ -45,7 +45,7 @@ public class DefaultToolchainManager
@Requirement( role = ToolchainFactory.class )
Map factories;
-
+
@Override
public Toolchain getToolchainFromBuildContext( String type, MavenSession session )
{
@@ -56,7 +56,7 @@ public Toolchain getToolchainFromBuildContext( String type, MavenSession session
if ( model != null )
{
List toolchains = selectToolchains( Collections.singletonList( model ), type, null );
-
+
if ( !toolchains.isEmpty() )
{
return toolchains.get( 0 );
@@ -109,7 +109,7 @@ private List selectToolchains( List models, String ty
}
return toolchains;
}
-
+
Map retrieveContext( MavenSession session )
{
Map context = null;
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
index 40db38994d98..d33ef9bc1224 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
@@ -60,7 +60,7 @@ public ToolchainPrivate[] getToolchainsForType( String type, MavenSession contex
toRet.add( fact.createToolchain( toolchainModel ) );
}
}
-
+
// add default toolchain
ToolchainPrivate tool = fact.createDefaultToolchain();
if ( tool != null )
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java b/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java
index 3d6917bd82f3..02f5cc0a4200 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java
@@ -59,7 +59,7 @@ public boolean matches( String requirement )
{
return provides.equalsIgnoreCase( requirement );
}
-
+
@Override
public String toString()
{
@@ -99,7 +99,7 @@ public boolean matches( String requirement )
return false;
}
}
-
+
@Override
public String toString()
{
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java
index bc0a91dd4c75..134c24da0a52 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java
@@ -49,11 +49,11 @@ public interface ToolchainManager
* @return the toolchain selected by maven-toolchains-plugin
*/
Toolchain getToolchainFromBuildContext( String type, MavenSession context );
-
+
/**
* Select all toolchains available in user settings matching the type and requirements,
* independently from maven-toolchains-plugin.
- *
+ *
* @param session the Maven session, must not be {@code null}
* @param type the type, must not be {@code null}
* @param requirements the requirements, may be {@code null}
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java
index 6836bf1c7985..ed50bd46abf5 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java
@@ -37,7 +37,7 @@ public interface ToolchainManagerPrivate
/**
* Retrieves every toolchains of given type available in user settings.
- *
+ *
* @param type the type, must not be {@code null}
* @param context the Maven session, must not be {@code null}
* @since 3.0 (addition of the MavenSession parameter)
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java
index 756cd957c95d..d935661e1e55 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java
@@ -40,7 +40,7 @@ public interface ToolchainPrivate
boolean matchesRequirements( Map requirements );
/**
- *
+ *
* @return the original model wrapped by this interface
*/
ToolchainModel getModel();
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java
index 7983388bd289..7abd0fe79cae 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java
@@ -39,7 +39,7 @@
import org.apache.maven.toolchain.model.TrackableBase;
/**
- *
+ *
* @author Robert Scholte
* @since 3.3.0
*/
@@ -49,7 +49,7 @@ public class DefaultToolchainsBuilder
implements ToolchainsBuilder
{
private MavenToolchainMerger toolchainsMerger = new MavenToolchainMerger();
-
+
@Inject
private ToolchainsReader toolchainsReader;
@@ -58,21 +58,21 @@ public ToolchainsBuildingResult build( ToolchainsBuildingRequest request )
throws ToolchainsBuildingException
{
ProblemCollector problems = ProblemCollectorFactory.newInstance( null );
-
+
PersistedToolchains globalToolchains = readToolchains( request.getGlobalToolchainsSource(), request, problems );
PersistedToolchains userToolchains = readToolchains( request.getUserToolchainsSource(), request, problems );
toolchainsMerger.merge( userToolchains, globalToolchains, TrackableBase.GLOBAL_LEVEL );
-
+
problems.setSource( "" );
-
+
if ( hasErrors( problems.getProblems() ) )
{
throw new ToolchainsBuildingException( problems.getProblems() );
}
-
-
+
+
return new DefaultToolchainsBuildingResult( userToolchains, problems.getProblems() );
}
@@ -119,7 +119,7 @@ private PersistedToolchains readToolchains( Source toolchainsSource, ToolchainsB
return toolchains;
}
-
+
private boolean hasErrors( List problems )
{
if ( problems != null )
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java
index 144d724cffa2..3c0e65d4779d 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java
@@ -33,7 +33,7 @@ public class DefaultToolchainsBuildingRequest
private Source globalToolchainsSource;
private Source userToolchainsSource;
-
+
@Override
public Source getGlobalToolchainsSource()
{
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java
index 60ca24410ec0..d06650c29822 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java
@@ -27,7 +27,7 @@
/**
* Holds the result of the merged toolchains and holds the problems during this build, if any.
- *
+ *
* @author Robert Scholte
* @since 3.3.0
*/
@@ -36,12 +36,12 @@ public class DefaultToolchainsBuildingResult
{
private PersistedToolchains effectiveToolchains;
-
+
private List problems;
-
+
/**
* Default constructor
- *
+ *
* @param effectiveToolchains the merged toolchains, may not be {@code null}
* @param problems the problems while building the effectiveToolchains, if any.
*/
@@ -56,7 +56,7 @@ public PersistedToolchains getEffectiveToolchains()
{
return effectiveToolchains;
}
-
+
@Override
public List getProblems()
{
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java
index 592fb98c3bb1..f7c5f71554a8 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java
@@ -42,7 +42,7 @@ public interface ToolchainsBuildingResult
/**
* Return a list of problems, if any.
- *
+ *
* @return a list of problems, never {@code null}.
*/
List getProblems();
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java b/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java
index 9cfcff385554..ac29f1f6d682 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java
@@ -26,7 +26,7 @@
* Provides backwards compatibility with Maven 3.2.3 and earlier. Clients that do not require compatibility with Maven
* 3.2.3 and earlier are encouraged to use {@link JavaToolchainImpl}.
* Note: This is an internal component whose interface can change without prior notice.
- *
+ *
* @deprecated clients that do not require compatibility with Maven 3.2.3 and earlier should link to
* {@link JavaToolchainImpl} instead.
*/
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java b/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java
index ca910d8749c1..43888eda1a18 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java
@@ -28,7 +28,7 @@
import org.codehaus.plexus.util.xml.Xpp3Dom;
/**
- *
+ *
* @author Robert Scholte
* @since 3.2.4
*/
@@ -55,14 +55,14 @@ private void shallowMerge( List dominant, List r
for ( ToolchainModel dominantModel : dominant )
{
Object key = getToolchainModelKey( dominantModel );
-
+
merged.put( key, dominantModel );
}
for ( ToolchainModel recessiveModel : recessive )
{
Object key = getToolchainModelKey( recessiveModel );
-
+
ToolchainModel dominantModel = merged.get( key );
if ( dominantModel == null )
{
diff --git a/maven-core/src/main/mdo/toolchains.mdo b/maven-core/src/main/mdo/toolchains.mdo
index 4740d1b96c60..161e5a4d37b4 100644
--- a/maven-core/src/main/mdo/toolchains.mdo
+++ b/maven-core/src/main/mdo/toolchains.mdo
@@ -182,7 +182,7 @@
diff --git a/maven-core/src/site/apt/index.apt b/maven-core/src/site/apt/index.apt
index 966b57c518ba..1e7a68ee68f6 100644
--- a/maven-core/src/site/apt/index.apt
+++ b/maven-core/src/site/apt/index.apt
@@ -27,14 +27,25 @@ Maven Core
Maven Core classes managing the whole build process.
-* Useful entry points
+* Reference Documentation
* {{{./lifecycles.html}lifecycles}} and {{{./default-bindings.html}plugin bindings to <<>> lifecycle}},
* {{{./artifact-handlers.html}default artifact handlers}},
+ * {{{./extension.html}extension descriptor}} and {{{./core-extensions.html}core extensions}},
+
+ * {{{/guides/mini/guide-maven-classloading.html}classloader hierarchy}} done by <<>> component
+ ({{{./apidocs/org/apache/maven/classrealm/ClassRealmManager.html}javadoc}}),
+ with its <<>> implementation
+ ({{{./xref/org/apache/maven/classrealm/DefaultClassRealmManager.html}source}}), using
+ {{{https://codehaus-plexus.github.io/plexus-classworlds/}Plexus Classworlds}},
+
+* Useful entry points
+
* <<>> component ({{{./apidocs/org/apache/maven/Maven.html}javadoc}}),
- with its <<>> implementation ({{{./xref/org/apache/maven/DefaultMaven.html}source}}),
+ with its <<>> implementation ({{{./xref/org/apache/maven/DefaultMaven.html}source}}), to drive
+ a full <<>> execution ({{{./apidocs/org/apache/maven/execution/MavenSession.html}javadoc}}
* <<>> component ({{{./apidocs/org/apache/maven/project/ProjectBuilder.html}javadoc}}),
with its <<>> implementation
@@ -47,14 +58,6 @@ Maven Core
* {{{./apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html}PluginParameterExpressionEvaluator}}, used to
evaluate plugin parameters values during Mojo configuration,
- * {{{/guides/mini/guide-maven-classloading.html}classloader hierarchy}} done by <<>> component
- ({{{./apidocs/org/apache/maven/classrealm/ClassRealmManager.html}javadoc}}),
- with its <<>> implementation
- ({{{./xref/org/apache/maven/classrealm/DefaultClassRealmManager.html}source}}), using
- {{{https://codehaus-plexus.github.io/plexus-classworlds/}Plexus Classworlds}},
-
- * {{{./extension.html}extension descriptor}} and {{{./core-extensions.html}core extensions}},
-
* <<>> component ({{{./apidocs/org/apache/maven/exception/ExceptionHandler.html}javadoc}}),
with its <<>> implementation
({{{./xref/org/apache/maven/exception/DefaultExceptionHandler.html}source}}), use to transform exception into useful end-user messages.
diff --git a/maven-core/src/site/apt/scripting-support/marmalade-support.apt b/maven-core/src/site/apt/scripting-support/marmalade-support.apt
deleted file mode 100644
index 7a8096620a43..000000000000
--- a/maven-core/src/site/apt/scripting-support/marmalade-support.apt
+++ /dev/null
@@ -1,196 +0,0 @@
-~~ Licensed to the Apache Software Foundation (ASF) under one
-~~ or more contributor license agreements. See the NOTICE file
-~~ distributed with this work for additional information
-~~ regarding copyright ownership. The ASF licenses this file
-~~ to you under the Apache License, Version 2.0 (the
-~~ "License"); you may not use this file except in compliance
-~~ with the License. You may obtain a copy of the License at
-~~
-~~ http://www.apache.org/licenses/LICENSE-2.0
-~~
-~~ Unless required by applicable law or agreed to in writing,
-~~ software distributed under the License is distributed on an
-~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-~~ KIND, either express or implied. See the License for the
-~~ specific language governing permissions and limitations
-~~ under the License.
-
- ---
- Marmalade Mojo Support - Notes
- ---
- John Casey
- ---
- 07-Feb-2005
- ---
-
-Marmalade Support
-
-*Abstract
-
- This document will track the design and implementation issues involved in
- adding support to m2 for marmalade-based mojos.
-
-*Design Notes
-
- [[1]] <>
-
- As in all mojo specifications, it is ideal that the descriptor for
- a marmalade-based mojo be inline with the source code. This centralizes
- all maintenance related to a single mojo to a single point of maintenance.
-
- The following is what I'm thinking as of now:
-
- - a marmalade-based mojo should look something like:
-
-+---+
-
-
-
- mmld
- mmldCompile
- compile
- Used to compile marmalade scripts into java beans.
-
-
-
-
-
-
-
-
- classpath
- The compilation classpath
- java.util.List
- #pom.artifacts
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-+---+
-[NOTE] All empty elements above signify optional elements, usage specification.
-
- [[2]] <>
-
- The marmalade mojo packager will:
-
- [[a]] Locate all *.mmld files within the scripts directory of the project.
-
- The scripts directory should be tied to the script language within
- the POM. Until we have multiple language support in the POM, we'll
- use something like: <<>>.
-
- [[b]] For each script found:
-
- [[i]] Execute the script with "gatherMetadata=true" in the context.
-
- [[ii]] Retrieve the mojo descriptor from the resulting "metadata"
- variable in the context.
-
- [[iii]] Cache the mojo descriptor in aggregator for subsequent
- output to plugin descriptor file.
-
- [[c]] Copy all scripts to the target directory. Preserve relative paths.
-
- [[d]] <>
-
- [[e]] Use the project's dependencies and other info to form the plugin
- descriptor's header (non-mojo-specific info).
-
- [[f]] Use the PluginGenerator from maven-plugin-tools to generate a
- META-INF/plexus/plugin.xml to the target directory.
-
- [[g]] Continue with lifecycle.
-
- This may include compilation of java helper classes, etc. and
- plugin-artifact packaging, presumably via 'jar:jar' or similar.
-
- [[3]] <>
-
- The marmalade mojo loader will:
-
- [[a]] Retrieve the implementation spec (this is the path of the script,
- relative to the root of the plugin filesystem...jar, etc.) to
- $path.
-
- [[b]] Use the context classloader to retrieve a reader to $path.
-
- [[c]] Build the ScriptBuilder corresponding to the script.
-
- [[d]] Create a new MarmaladeMojo instance which adapts the mojo calling
- semantics to the creation/execution of a marmalade script.
-
- Execution involves:
-
- [[i]] Creating a new MarmaladeScript instance.
-
- [[ii]] Creating an execution context which references all I/O
- from the main Maven execution thread, and embeds:
-
- - #request == MavenExecutionRequest
-
- - #response == MavenExecutionResponse
-
- - Any globally configured environmental constraints, such
- as a global preserve-whitespace setting
-
- [[iii]] Execution of the script using the execution context.
-
- [[iv]] Export of the resulting context, minus any surviving input
- variables, to the MavenExecutionResponse's out-params.
-
-*Implementation Issues
-
- [[1]] How do we make Maven smart enough to switch loader implementations based
- on some sub-type of maven-plugin?
-
- This is important, since the default mojo loader will not be smart
- enough to do the job, and embedding this behavior in that loader is not
- scalable or extensible enough to accommodate future expansion into the
- realms of jython, groovy, etc...
-
- <>
-
- We'll plan on using some sort of language specification in the mojo
- descriptor to determine which mojo loader to use, then we'll populate
- the PluginLoader/PluginManager with a map of known languages->loaders.
-
- [[2]] How do we make the plugin:install process smart enough to switch
- generator implementations based on some sub-type of maven-plugin?
-
- This is closely related to [1] above.
-
- <>
-
- See update in [3].
-
- [[3]] Do we want to allow mixed-bag plugin implementations?
-
- These might include a mix of standard-java and marmalade mojos. It
- strikes me that many marmalade-based mojos may use beans/tags that are
- actually adapter classes for other third-party APIs (why they wouldn't
- implement everything as java mojos in this cases is beyond me). If they
- have java source inside the plugin source directory, we should probably
- compile it and bundle it with the plugin scripts; but what if this source
- also has mojo annotations? This will have implications for [1] and [2]
- above.
-
- <>
-
- We will plan on allowing this sort of implementation, and simply start
- by applying all known generators which have a source directory set in
- the POM (or later, have a section, maybe). At any rate,
- helper classes will be allowed for script-based mojos.
diff --git a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java
index 15a7a7b3b6a8..bcc5895b7b9d 100644
--- a/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java
+++ b/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java
@@ -34,7 +34,7 @@ public class DefaultMavenExecutionRequestPopulatorTest
{
@Inject
MavenExecutionRequestPopulator testee;
-
+
public void testPluginRepositoryInjection()
throws Exception
{
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java
index 951f133df42b..dfa1817b8f4d 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java
@@ -409,7 +409,7 @@ public List getDownstreamProjects( MavenProject project, boolean t
{
return Collections.emptyList();
}
-
+
public java.util.List getAllSortedProjects()
{
return Collections.emptyList();
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/AboutTheStubs.html b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/AboutTheStubs.html
index 8ad74b96bcbe..02332822bd53 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/AboutTheStubs.html
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/AboutTheStubs.html
@@ -36,7 +36,7 @@