diff --git a/build.xml b/build.xml
index 78e5e18029..5d2403137f 100644
--- a/build.xml
+++ b/build.xml
@@ -38,7 +38,7 @@ TODO:
-
+
@@ -89,20 +89,20 @@ TODO:
-
+
-
+
-
+
@@ -166,7 +166,7 @@ TODO:
-
+
@@ -183,7 +183,7 @@ TODO:
-
+
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 140c85f0c7..1b688ab75e 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -45,14 +45,6 @@
org.codehaus.plexus
plexus-component-metadata
- 1.0-beta-2-SNAPSHOT
-
-
- org.codehaus.plexus
- plexus-container-default
- 1.0-beta-2-SNAPSHOT
-
-
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 521d06fce6..e57c5627ff 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -1,32 +1,22 @@
-
+
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
maven
org.apache.maven
3.0-SNAPSHOT
-
4.0.0
maven-core
Maven Core
@@ -71,7 +61,6 @@ under the License.
org.codehaus.plexus
plexus-interactivity-api
-
org.codehaus.plexus
plexus-interpolation
@@ -100,9 +89,25 @@ under the License.
1.0-alpha-1
test
+
+ org.codehaus.plexus
+ plexus-component-annotations
+
+
+ org.sonatype.plexus
+ plexus-plugin-manager
+
+
+ org.apache.maven.shared
+ maven-shared-model
+
+
+ org.codehaus.plexus
+ plexus-component-metadata
+
org.codehaus.modello
modello-maven-plugin
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index 0e2229f716..f4980f5364 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -155,14 +155,9 @@ public class DefaultMaven
String event = MavenEvents.MAVEN_EXECUTION;
- dispatcher.dispatchStart(
- event,
- request.getBaseDirectory() );
+ dispatcher.dispatchStart( event, request.getBaseDirectory() );
- MavenSession session = createSession(
- request,
- reactorManager,
- dispatcher );
+ MavenSession session = createSession( request, reactorManager, dispatcher );
if ( request.getGoals() != null )
{
@@ -205,10 +200,7 @@ public class DefaultMaven
try
{
- lifecycleExecutor.execute(
- session,
- reactorManager,
- dispatcher );
+ lifecycleExecutor.execute( session, reactorManager, dispatcher );
}
catch ( LifecycleExecutionException e )
{
@@ -391,11 +383,7 @@ public class DefaultMaven
ReactorManager reactorManager,
EventDispatcher dispatcher )
{
- MavenSession session = new MavenSession(
- container,
- request,
- dispatcher,
- reactorManager );
+ MavenSession session = new MavenSession( container, request, dispatcher, reactorManager );
return session;
}
diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
index 70ada9e260..bc0b540ebd 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
@@ -1,26 +1,29 @@
package org.apache.maven.execution;
/*
- * 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.
+ * 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.
*/
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.errors.CoreErrorReporter;
+import org.apache.maven.listeners.BuildExtensionListener;
import org.apache.maven.monitor.event.EventMonitor;
import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.profiles.activation.ProfileActivationContext;
@@ -28,13 +31,10 @@ import org.apache.maven.project.DefaultProjectBuilderConfiguration;
import org.apache.maven.project.ProjectBuilderConfiguration;
import org.apache.maven.realm.MavenRealmManager;
import org.apache.maven.settings.Settings;
+import org.apache.maven.shared.model.ModelEventListener;
import org.apache.maven.wagon.events.TransferListener;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
/**
* @author Jason van Zyl
@@ -44,9 +44,9 @@ public class DefaultMavenExecutionRequest
implements MavenExecutionRequest
{
private ArtifactRepository localRepository;
-
+
private File localRepositoryPath;
-
+
private boolean offline = false;
private boolean interactiveMode = true;
@@ -115,58 +115,56 @@ public class DefaultMavenExecutionRequest
private ProfileManager profileManager;
- private List remoteRepositories;
+ private List remoteRepositories;
/**
* Suppress SNAPSHOT updates.
+ *
* @issue MNG-2681
*/
private boolean noSnapshotUpdates;
private MavenRealmManager realmManager;
-
- public DefaultMavenExecutionRequest()
+
+ public static MavenExecutionRequest copy( MavenExecutionRequest original )
{
- // default constructor.
+ DefaultMavenExecutionRequest copy = new DefaultMavenExecutionRequest();
+ copy.setLocalRepository( original.getLocalRepository() );
+ copy.setLocalRepositoryPath( original.getLocalRepositoryPath() );
+ copy.setOffline( original.isOffline() );
+ copy.setInteractiveMode( original.isInteractiveMode() );
+ copy.setProxies( original.getProxies() );
+ copy.setServers( original.getServers() );
+ copy.setMirrors( original.getMirrors() );
+ copy.setProfiles( original.getProfiles() );
+ copy.setPluginGroups( original.getPluginGroups() );
+ copy.setUsePluginUpdateOverride( original.isUsePluginUpdateOverride() );
+ copy.setProjectPresent( original.isProjectPresent() );
+ copy.setUserSettingsFile( original.getUserSettingsFile() );
+ copy.setGlobalSettingsFile( original.getGlobalSettingsFile() );
+ copy.setBaseDirectory( new File( original.getBaseDirectory() ) );
+ copy.setGoals( original.getGoals() );
+ copy.setUseReactor( original.useReactor() );
+ copy.setRecursive( original.isRecursive() );
+ copy.setPom( original.getPom() );
+ copy.setReactorFailureBehavior( original.getReactorFailureBehavior() );
+ copy.setProperties( original.getProperties() );
+ copy.setStartTime( original.getStartTime() );
+ copy.setShowErrors( original.isShowErrors() );
+ copy.setEventMonitors( original.getEventMonitors());
+ copy.setActiveProfiles( original.getActiveProfiles());
+ copy.setInactiveProfiles( original.getInactiveProfiles());
+ copy.setTransferListener( original.getTransferListener());
+ copy.setLoggingLevel( original.getLoggingLevel());
+ copy.setGlobalChecksumPolicy( original.getGlobalChecksumPolicy());
+ copy.setUpdateSnapshots( original.isUpdateSnapshots());
+ copy.setProfileManager( original.getProfileManager() );
+ copy.setRemoteRepositories( original.getRemoteRepositories() );
+ copy.setNoSnapshotUpdates( original.isNoSnapshotUpdates() );
+ copy.setRealmManager( original.getRealmManager() );
+ return original;
}
-
- public DefaultMavenExecutionRequest( MavenExecutionRequest original )
- {
- localRepository = original.getLocalRepository();
- localRepositoryPath = original.getLocalRepositoryPath();
- offline = original.isOffline();
- interactiveMode = original.isInteractiveMode();
- proxies = original.getProxies();
- servers = original.getServers();
- mirrors = original.getMirrors();
- profiles = original.getProfiles();
- pluginGroups = original.getPluginGroups();
- usePluginUpdateOverride = original.isUsePluginUpdateOverride();
- isProjectPresent = original.isProjectPresent();
- userSettingsFile = original.getUserSettingsFile();
- globalSettingsFile = original.getGlobalSettingsFile();
- basedir = new File( original.getBaseDirectory() );
- goals = original.getGoals();
- useReactor = original.useReactor();
- recursive = original.isRecursive();
- pom = original.getPom();
- reactorFailureBehavior = original.getReactorFailureBehavior();
- properties = original.getProperties();
- startTime = original.getStartTime();
- showErrors = original.isShowErrors();
- eventMonitors = original.getEventMonitors();
- activeProfiles = original.getActiveProfiles();
- inactiveProfiles = original.getInactiveProfiles();
- transferListener = original.getTransferListener();
- loggingLevel = original.getLoggingLevel();
- globalChecksumPolicy = original.getGlobalChecksumPolicy();
- updateSnapshots = original.isUpdateSnapshots();
- profileManager = original.getProfileManager();
- remoteRepositories = original.getRemoteRepositories();
- noSnapshotUpdates = original.isNoSnapshotUpdates();
- realmManager = original.getRealmManager();
- }
-
+
public String getBaseDirectory()
{
if ( basedir == null )
@@ -233,6 +231,36 @@ public class DefaultMavenExecutionRequest
return eventMonitors;
}
+ public void setBasedir( File basedir )
+ {
+ this.basedir = basedir;
+ }
+
+ public void setEventMonitors( List eventMonitors )
+ {
+ this.eventMonitors = eventMonitors;
+ }
+
+ public void setActiveProfiles( List activeProfiles )
+ {
+ this.activeProfiles = activeProfiles;
+ }
+
+ public void setInactiveProfiles( List inactiveProfiles )
+ {
+ this.inactiveProfiles = inactiveProfiles;
+ }
+
+ public void setRemoteRepositories( List remoteRepositories )
+ {
+ this.remoteRepositories = remoteRepositories;
+ }
+
+ public void setProjectBuildingConfiguration( ProjectBuilderConfiguration projectBuildingConfiguration )
+ {
+ this.projectBuildingConfiguration = projectBuildingConfiguration;
+ }
+
public List getActiveProfiles()
{
if ( activeProfiles == null )
@@ -656,7 +684,7 @@ public class DefaultMavenExecutionRequest
{
if ( remoteRepositories == null )
{
- remoteRepositories = new ArrayList();
+ remoteRepositories = new ArrayList();
}
remoteRepositories.add( repository );
@@ -664,7 +692,7 @@ public class DefaultMavenExecutionRequest
return this;
}
- public List getRemoteRepositories()
+ public List getRemoteRepositories()
{
return remoteRepositories;
}
@@ -730,6 +758,7 @@ public class DefaultMavenExecutionRequest
projectBuildingConfiguration.setGlobalProfileManager( getProfileManager() );
projectBuildingConfiguration.setUserProperties( getUserProperties() );
projectBuildingConfiguration.setBuildStartTime( getStartTime() );
+ projectBuildingConfiguration.setRemoteRepositories( getRemoteRepositories() );
}
return projectBuildingConfiguration;
diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
index ee18beb8d1..2a63ea4ae3 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
@@ -19,6 +19,11 @@ package org.apache.maven.execution;
* under the License.
*/
+import java.io.File;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.errors.CoreErrorReporter;
@@ -31,11 +36,6 @@ import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.events.TransferListener;
import org.codehaus.plexus.logging.Logger;
-import java.io.File;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-
/**
* @author Jason van Zyl
* @version $Id$
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
index ba3113fe22..87abeebce9 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
@@ -151,10 +151,7 @@ public class DefaultLifecycleExecutor
throw new NoGoalsSpecifiedException( buffer.toString() );
}
- List taskSegments = segmentTaskListByAggregationNeeds(
- goals,
- session,
- rootProject );
+ List taskSegments = segmentTaskListByAggregationNeeds( goals, session, rootProject );
try
{
@@ -162,19 +159,10 @@ public class DefaultLifecycleExecutor
}
catch ( LifecycleException e )
{
- e.printStackTrace();
- throw new LifecycleExecutionException(
- "Failed to construct one or more initial build plans."
- + " Reason: " + e.getMessage(),
- e );
+ throw new LifecycleExecutionException( "Failed to construct one or more initial build plans." + " Reason: " + e.getMessage(), e );
}
- executeTaskSegments(
- taskSegments,
- reactorManager,
- session,
- rootProject,
- dispatcher );
+ executeTaskSegments( taskSegments, reactorManager, session, rootProject, dispatcher );
}
/**
@@ -210,7 +198,7 @@ public class DefaultLifecycleExecutor
for ( Iterator projectIterator = sortedProjects.iterator(); projectIterator.hasNext(); )
{
MavenProject currentProject = (MavenProject) projectIterator.next();
-
+
executeTaskSegmentForProject( segment, currentProject, reactorManager, dispatcher, session );
}
}
@@ -255,11 +243,7 @@ public class DefaultLifecycleExecutor
session.setCurrentProject( project );
// NEW: Build up the execution plan, including configuration.
- List mojoBindings = getLifecycleBindings(
- segment.getTasks(),
- project,
- session,
- target );
+ List mojoBindings = getLifecycleBindings( segment.getTasks(), project, session, target );
String currentPhase = null;
diff --git a/maven-core/src/main/java/org/apache/maven/listeners/BuildExtensionListener.java b/maven-core/src/main/java/org/apache/maven/listeners/BuildExtensionListener.java
new file mode 100644
index 0000000000..3a36a59bc5
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/listeners/BuildExtensionListener.java
@@ -0,0 +1,166 @@
+package org.apache.maven.listeners;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.builder.ArtifactModelContainerFactory;
+import org.apache.maven.project.builder.ProjectUri;
+import org.apache.maven.shared.model.ModelContainer;
+import org.apache.maven.shared.model.ModelContainerFactory;
+import org.apache.maven.shared.model.ModelEventListener;
+import org.apache.maven.shared.model.ModelProperty;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Configuration;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+import org.sonatype.plexus.plugin.manager.PlexusPluginManager;
+import org.sonatype.plexus.plugin.manager.PluginMetadata;
+import org.sonatype.plexus.plugin.manager.PluginResolutionRequest;
+import org.sonatype.plexus.plugin.manager.PluginResolutionResult;
+
+// I need access to the local repository
+// i need the remote repositories
+// i need filters to keep stuff out of the realm that exists
+
+@Component(role = MavenModelEventListener.class, hint="extensions", instantiationStrategy="per-lookup" )
+public class BuildExtensionListener
+ implements MavenModelEventListener
+{
+ @Configuration(value = "true")
+ private boolean inBuild = true;
+
+ @Requirement
+ PlexusPluginManager pluginManager;
+
+ private List buildExtensions = new ArrayList();
+
+ public void fire( List modelContainers )
+ {
+ if ( !inBuild )
+ {
+ return;
+ }
+
+ for ( ModelContainer mc : modelContainers )
+ {
+ if ( hasExtension( mc ) )
+ {
+ buildExtensions.add( new BuildExtension( mc.getProperties() ) );
+ }
+ }
+ }
+
+ public List getUris()
+ {
+ return Arrays.asList( ProjectUri.Build.Extensions.Extension.xUri );
+ }
+
+ public Collection getModelContainerFactories()
+ {
+ return Arrays.asList( (ModelContainerFactory) new ArtifactModelContainerFactory() );
+ }
+
+ private static boolean hasExtension( ModelContainer container )
+ {
+ for ( ModelProperty mp : container.getProperties() )
+ {
+ if ( mp.getUri().equals( ProjectUri.Build.Extensions.Extension.xUri ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static class BuildExtension
+ {
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ public BuildExtension( String groupId, String artifactId, String version )
+ {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.version = version;
+ }
+
+ BuildExtension( List modelProperties )
+ {
+ for ( ModelProperty mp : modelProperties )
+ {
+ if ( mp.getUri().equals( ProjectUri.Build.Extensions.Extension.groupId ) )
+ {
+ groupId = mp.getValue();
+ }
+ else if ( mp.getUri().equals( ProjectUri.Build.Extensions.Extension.artifactId ) )
+ {
+ artifactId = mp.getValue();
+ }
+ else if ( mp.getUri().equals( ProjectUri.Build.Extensions.Extension.version ) )
+ {
+ version = mp.getValue();
+ }
+ }
+ }
+ }
+
+ // Processing the information that was collected.
+
+ public void processModelContainers( MavenSession session )
+ {
+ for ( BuildExtension be : buildExtensions )
+ {
+ PluginResolutionRequest request = new PluginResolutionRequest()
+ .setPluginMetadata( new PluginMetadata( be.groupId, be.artifactId, be.version ) )
+ .addLocalRepository( session.getRequest().getLocalRepositoryPath() )
+ .setRemoteRepositories( convertToMercuryRepositories( session.getRequest().getRemoteRepositories() ) );
+
+ PluginResolutionResult result = null;
+
+ try
+ {
+ result = pluginManager.resolve( request );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace();
+ }
+
+ ClassRealm realm = pluginManager.createClassRealm( result.getArtifacts() );
+
+ realm.display();
+
+ List> components = pluginManager.discoverComponents( realm );
+ }
+ }
+
+ List convertToMercuryRepositories( List repositories )
+ {
+ List repos = new ArrayList();
+
+ if ( repositories != null )
+ {
+ for ( ArtifactRepository r : repositories )
+ {
+ repos.add( r.getUrl() );
+ }
+ }
+ else
+ {
+ // I'm doing this because I am about to rip the artifact clusterfuck out and
+ // replace it with mercury and I don't want to pull in 5 component to make a
+ // remote repository. This will do until alpha-2.
+ repos.add( "http://repo1.maven.org/maven2" );
+ }
+
+ return repos;
+ }
+}
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
index fb8d4e88d5..e4ed462980 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
@@ -315,7 +315,7 @@ public class DefaultPluginManager
{
getLogger().debug( "Discovering components in realm: " + pluginRealm );
- container.discoverComponents( pluginRealm, false );
+ container.discoverComponents( pluginRealm );
}
catch ( PlexusConfigurationException e )
{
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java
index 01b68233e2..027eb084d7 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManagerSupport.java
@@ -43,6 +43,8 @@ import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.apache.maven.realm.RealmManagementException;
import org.apache.maven.realm.RealmScanningUtils;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.logging.LogEnabled;
@@ -52,20 +54,26 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import java.util.ArrayList;
import java.util.List;
+@Component(role = PluginManagerSupport.class)
public class DefaultPluginManagerSupport
implements PluginManagerSupport, LogEnabled, Contextualizable
{
-
+ @Requirement
private ArtifactResolver artifactResolver;
-
+
+ @Requirement
private ArtifactFactory artifactFactory;
-
+
+ @Requirement
private MavenProjectBuilder mavenProjectBuilder;
-
+
+ @Requirement
private RuntimeInformation runtimeInformation;
-
+
+ @Requirement
private PluginVersionManager pluginVersionManager;
-
+
+ //@Requirement
private Logger logger;
private Context containerContext;
@@ -90,8 +98,6 @@ public class DefaultPluginManagerSupport
List remoteRepositories = new ArrayList();
-// remoteRepositories.addAll( project.getPluginArtifactRepositories() );
-
remoteRepositories.addAll( project.getRemoteArtifactRepositories() );
MavenProject pluginProject = null;
diff --git a/maven-core/src/main/resources/META-INF/plexus/components.xml b/maven-core/src/main/resources/META-INF/plexus/components.xml
index a3b36bdbc4..4782602f3e 100644
--- a/maven-core/src/main/resources/META-INF/plexus/components.xml
+++ b/maven-core/src/main/resources/META-INF/plexus/components.xml
@@ -22,7 +22,7 @@ under the License.
diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java
index 8373447628..412132f102 100644
--- a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java
+++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java
@@ -472,17 +472,11 @@ public class PluginParameterExpressionEvaluatorTest
model.setVersion( "1" );
MavenProject project = new MavenProject( model );
-
- ReactorManager rm = new ReactorManager( Collections.singletonList( project ),
- ReactorManager.FAIL_FAST );
-
- MockControl reqCtl = MockControl.createControl( MavenExecutionRequest.class );
- MavenExecutionRequest req = (MavenExecutionRequest) reqCtl.getMock();
-
- MavenSession session = new MavenSession( getContainer(), req, new DefaultEventDispatcher(),
- rm );
+ ReactorManager rm = new ReactorManager( Collections.singletonList( project ), ReactorManager.FAIL_FAST );
+ MockControl mockMavenExecutionRequest = MockControl.createControl( MavenExecutionRequest.class );
+ MavenExecutionRequest req = (MavenExecutionRequest) mockMavenExecutionRequest.getMock();
+ MavenSession session = new MavenSession( getContainer(), req, new DefaultEventDispatcher(), rm );
return session;
}
-
}
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 5af5b93d4e..cda154e0f6 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -132,7 +132,7 @@ public class MavenCli
{
CLIReportingUtils.showVersion();
}
-
+
MavenExecutionRequest request = CLIRequestUtils.buildRequest( commandLine, debug, quiet, showErrors );
Configuration configuration = buildEmbedderConfiguration( request, commandLine, classWorld );
diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
index 9e33bbbdde..8d0b3a7070 100644
--- a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
+++ b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
@@ -103,7 +103,7 @@ import org.codehaus.plexus.util.dag.CycleDetectedException;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
- * Class intended to be used by clients who wish to embed Maven into their applications
+ * Class intended to be used by clients who wish to embed Maven into their applications.
*
* @author Jason van Zyl
*/
@@ -152,7 +152,7 @@ public class MavenEmbedder
private MavenExecutionRequestPopulator populator;
private BuildPlanner buildPlanner;
-
+
// ----------------------------------------------------------------------
// Configuration
// ----------------------------------------------------------------------
@@ -506,7 +506,7 @@ public class MavenEmbedder
boolean allowUnbindableMojos )
throws MavenEmbedderException
{
- MavenExecutionRequest req = new DefaultMavenExecutionRequest( request );
+ MavenExecutionRequest req = DefaultMavenExecutionRequest.copy( request );
req.setGoals( goals );
EventDispatcher dispatcher = new DefaultEventDispatcher( req.getEventMonitors() );
@@ -709,7 +709,7 @@ public class MavenEmbedder
try
{
- container.discoverComponents( childRealm, true );
+ container.discoverComponents( childRealm );
}
catch ( PlexusConfigurationException e )
{
diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java b/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
index 2eb9029d4a..2327678b0c 100644
--- a/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
+++ b/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
@@ -122,7 +122,7 @@ public class DefaultMavenExecutionRequestPopulator
profileManager( request, configuration );
processSettings( request, configuration );
-
+
return request;
}
diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java b/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java
index 3f28035391..e78e4115ae 100644
--- a/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java
+++ b/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilderConfiguration.java
@@ -21,28 +21,30 @@ package org.apache.maven.project;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.profiles.ProfileManager;
+import org.apache.maven.shared.model.ModelEventListener;
+import org.codehaus.plexus.PlexusContainer;
import java.util.Date;
+import java.util.List;
import java.util.Properties;
public class DefaultProjectBuilderConfiguration
implements ProjectBuilderConfiguration
{
-
private ProfileManager globalProfileManager;
private ArtifactRepository localRepository;
+ private List remoteRepositories;
+
private Properties userProperties;
private Properties executionProperties = System.getProperties();
private Date buildStartTime;
- public DefaultProjectBuilderConfiguration()
- {
- }
-
+ private List listeners;
+
public ProjectBuilderConfiguration setGlobalProfileManager( ProfileManager globalProfileManager )
{
this.globalProfileManager = globalProfileManager;
@@ -64,6 +66,17 @@ public class DefaultProjectBuilderConfiguration
{
return localRepository;
}
+
+ public List getRemoteRepositories()
+ {
+ return remoteRepositories;
+ }
+
+ public ProjectBuilderConfiguration setRemoteRepositories( List remoteRepositories )
+ {
+ this.remoteRepositories = remoteRepositories;
+ return this;
+ }
public ProjectBuilderConfiguration setUserProperties( Properties userProperties )
{
@@ -103,4 +116,14 @@ public class DefaultProjectBuilderConfiguration
return this;
}
+ public List getModelEventListeners()
+ {
+ return listeners;
+ }
+
+ public ProjectBuilderConfiguration setModelEventListeners( List listeners )
+ {
+ this.listeners = listeners;
+ return this;
+ }
}
diff --git a/maven-project/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java b/maven-project/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java
index f8ce413a6c..128b923e0e 100644
--- a/maven-project/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java
+++ b/maven-project/src/main/java/org/apache/maven/project/ProjectBuilderConfiguration.java
@@ -2,14 +2,18 @@ package org.apache.maven.project;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.profiles.ProfileManager;
+import org.apache.maven.shared.model.ModelEventListener;
+import org.codehaus.plexus.PlexusContainer;
import java.util.Date;
+import java.util.List;
import java.util.Properties;
public interface ProjectBuilderConfiguration
{
-
ArtifactRepository getLocalRepository();
+
+ List getRemoteRepositories();
ProfileManager getGlobalProfileManager();
@@ -21,12 +25,13 @@ public interface ProjectBuilderConfiguration
ProjectBuilderConfiguration setLocalRepository( ArtifactRepository localRepository );
+ ProjectBuilderConfiguration setRemoteRepositories( List remoteRepositories );
+
ProjectBuilderConfiguration setUserProperties( Properties userProperties );
ProjectBuilderConfiguration setExecutionProperties( Properties executionProperties );
Date getBuildStartTime();
- ProjectBuilderConfiguration setBuildStartTime( Date buildStartTime );
-
+ ProjectBuilderConfiguration setBuildStartTime( Date buildStartTime );
}
diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
index 3b15674200..7e9b4fb4d1 100644
--- a/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
+++ b/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
@@ -19,21 +19,6 @@ package org.apache.maven.project.builder.impl;
* under the License.
*/
-import org.apache.maven.MavenTools;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.InvalidRepositoryException;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Parent;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectBuilderConfiguration;
-import org.apache.maven.project.builder.*;
-import org.apache.maven.project.validation.ModelValidationResult;
-import org.apache.maven.project.validation.ModelValidator;
-import org.apache.maven.shared.model.*;
-import org.codehaus.plexus.logging.LogEnabled;
-import org.codehaus.plexus.logging.Logger;
-
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -43,6 +28,31 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import org.apache.maven.MavenTools;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.InvalidRepositoryException;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilderConfiguration;
+import org.apache.maven.project.builder.ArtifactModelContainerFactory;
+import org.apache.maven.project.builder.IdModelContainerFactory;
+import org.apache.maven.project.builder.PomArtifactResolver;
+import org.apache.maven.project.builder.PomClassicDomainModel;
+import org.apache.maven.project.builder.PomClassicDomainModelFactory;
+import org.apache.maven.project.builder.PomClassicTransformer;
+import org.apache.maven.project.builder.ProjectBuilder;
+import org.apache.maven.project.validation.ModelValidationResult;
+import org.apache.maven.project.validation.ModelValidator;
+import org.apache.maven.shared.model.DomainModel;
+import org.apache.maven.shared.model.ImportModel;
+import org.apache.maven.shared.model.InterpolatorProperty;
+import org.apache.maven.shared.model.ModelEventListener;
+import org.apache.maven.shared.model.ModelTransformerContext;
+import org.codehaus.plexus.logging.LogEnabled;
+import org.codehaus.plexus.logging.Logger;
+
/**
* Default implementation of the project builder.
*/
@@ -60,7 +70,9 @@ public final class DefaultProjectBuilder
private ModelValidator validator;
private MavenTools mavenTools;
-
+
+ List listeners;
+
/**
* Default constructor
*/
@@ -160,17 +172,18 @@ public final class DefaultProjectBuilder
{
domainModels.add( new PomClassicDomainModel( model ) );
}
-
+
PomClassicTransformer transformer = new PomClassicTransformer( new PomClassicDomainModelFactory() );
+
ModelTransformerContext ctx = new ModelTransformerContext(
Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) );
-
+
PomClassicDomainModel transformedDomainModel = ( (PomClassicDomainModel) ctx.transform( domainModels,
transformer,
transformer,
importModels,
properties,
- null) );
+ listeners ) );
try
{
MavenProject mavenProject = new MavenProject( transformedDomainModel.getModel(), artifactFactory,
diff --git a/maven-project/src/main/resources/META-INF/plexus/components.xml b/maven-project/src/main/resources/META-INF/plexus/components.xml
index 3ffc41e6c6..b4f3eac51b 100644
--- a/maven-project/src/main/resources/META-INF/plexus/components.xml
+++ b/maven-project/src/main/resources/META-INF/plexus/components.xml
@@ -267,6 +267,6 @@ under the License.
org.apache.maven.artifact.repository.ArtifactRepositoryFactory
-
+
diff --git a/pom.xml b/pom.xml
index 44c02b13ba..aead1613a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.maven
maven-parent
- 10-SNAPSHOT
+ 9
../pom/maven/pom.xml
org.apache.maven
@@ -156,7 +156,7 @@ under the License.
org.codehaus.plexus
plexus-component-metadata
- 1.0-beta-2-SNAPSHOT
+ ${plexusVersion}
@@ -245,7 +245,7 @@ under the License.
org.apache.maven.plugins
maven-surefire-plugin
- 2.3
+ 2.4.2
org.apache.maven.plugins
@@ -254,15 +254,6 @@ under the License.
-
-
- maven-surefire-plugin
- 2.4.2
-
- once
-
-
-
maven-core
@@ -276,7 +267,7 @@ under the License.
maven-mercury
maven-embedder
maven-toolchain
- maven-compat
+ maven-compat
3.0-alpha-2-SNAPSHOT
@@ -286,7 +277,7 @@ under the License.
1.0-alpha-9
1.2_Java1.3
3.8.1
- 1.0-beta-2-SNAPSHOT
+ 1.0-beta-2
1.0-alpha-6
1.1
1.5.5
@@ -295,7 +286,6 @@ under the License.
1.0.0-alpha-2-SNAPSHOT
3.2.6
-
@@ -367,6 +357,11 @@ under the License.
+
+ org.apache.maven.artifact
+ maven-artifact
+ ${artifactVersion}
+
org.codehaus.plexus
plexus-utils
@@ -429,11 +424,6 @@ under the License.
wagon-ssh-external
${wagonVersion}
-
- org.apache.maven.artifact
- maven-artifact
- ${artifactVersion}
-
org.apache.maven.doxia
doxia-sink-api
@@ -469,23 +459,28 @@ under the License.
commons-logging
+
+
+ org.apache.maven.mercury
+ mercury-artifact
+ ${mercuryVersion}
- org.apache.maven.mercury
- mercury-artifact
- ${mercuryVersion}
-
-
- org.apache.maven.mercury
- mercury-external
- ${mercuryVersion}
-
+ org.apache.maven.mercury
+ mercury-external
+ ${mercuryVersion}
+
aspectj
aspectjrt
${aspectjVersion}
+
+ org.sonatype.plexus
+ plexus-plugin-manager
+ 1.0-SNAPSHOT
+