maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r931884 [7/7] - in /maven/maven-3/trunk: maven-compat/src/test/java/org/apache/maven/project/ maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/artifact/repository/ maven-core/src/main/java/org/apache/mave...
Date Thu, 08 Apr 2010 11:29:09 GMT
Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,171 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.lifecycle.LifecycleNotFoundException;
+import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException;
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.lifecycle.internal.ExecutionPlanItem;
+import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
+import org.apache.maven.lifecycle.internal.ProjectBuildList;
+import org.apache.maven.lifecycle.internal.ProjectSegment;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.plugin.InvalidPluginDescriptorException;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.MojoNotFoundException;
+import org.apache.maven.plugin.PluginDescriptorParsingException;
+import org.apache.maven.plugin.PluginNotFoundException;
+import org.apache.maven.plugin.PluginResolutionException;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
+import org.apache.maven.plugin.version.PluginVersionResolutionException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:kristian@zenior.no">Kristian Rosenvold</a>
+ */
+public class LifecycleExecutionPlanCalculatorStub
+    implements LifecycleExecutionPlanCalculator
+{
+    public final static MojoDescriptor CLEAN = createMojoDescriptor( "clean" );
+
+    public final static MojoDescriptor VALIDATE = createMojoDescriptor( "validate" );
+
+    public final static MojoDescriptor TEST_COMPILE = createMojoDescriptor( "test-compile" );
+
+    public final static MojoDescriptor PROCESS_TEST_RESOURCES = createMojoDescriptor( "process-test-resources" );
+
+    public final static MojoDescriptor PROCESS_RESOURCES = createMojoDescriptor( "process-resources" );
+
+    public final static MojoDescriptor COMPILE = createMojoDescriptor( "compile" );
+
+    public final static MojoDescriptor TEST = createMojoDescriptor( "test" );
+
+    public final static MojoDescriptor PACKAGE = createMojoDescriptor( "package" );
+
+    public final static MojoDescriptor INSTALL = createMojoDescriptor( "install" );
+
+    public int getNumberOfExceutions( ProjectBuildList projectBuildList )
+        throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
+        NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException,
+        LifecyclePhaseNotFoundException, LifecycleNotFoundException
+    {
+        int result = 0;
+        for ( ProjectSegment projectBuild : projectBuildList )
+        {
+            MavenExecutionPlan plan = calculateExecutionPlan( projectBuild.getSession(), projectBuild.getProject(),
+                                                              projectBuild.getTaskSegment().getTasks() );
+            result += plan.size();
+        }
+        return result;
+    }
+
+    public MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks )
+        throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
+        PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
+        NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException
+    {
+        if ( project.equals( ProjectDependencyGraphStub.A ) )
+        {
+            return getProjectAExceutionPlan();
+        }
+        if ( project.equals( ProjectDependencyGraphStub.B ) )
+        {
+            return getProjectBExecutionPlan();
+        }
+        // The remaining are basically "for future expansion"
+        List<MojoExecution> me = new ArrayList<MojoExecution>();
+        me.add( createMojoExecution( new Plugin(), "resources", "default-resources", PROCESS_RESOURCES ) );
+        me.add( createMojoExecution( new Plugin(), "compile", "default-compile", COMPILE ) );
+        return new MavenExecutionPlan( getScopes(), getScopes(),
+                                       DefaultLifecyclesStub.createDefaultLifeCycles().createExecutionPlanItem( project,
+                                                                                                                me ) );
+    }
+
+    public static MavenExecutionPlan getProjectAExceutionPlan()
+        throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
+        PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
+        NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException
+    {
+        List<MojoExecution> me = new ArrayList<MojoExecution>();
+        me.add( createMojoExecution( new Plugin(), "enforce", "enforce-versions", VALIDATE ) );
+        me.add( createMojoExecution( new Plugin(), "resources", "default-resources", PROCESS_RESOURCES ) );
+        me.add( createMojoExecution( new Plugin(), "compile", "default-compile", COMPILE ) );
+        me.add( createMojoExecution( new Plugin(), "testResources", "default-testResources", PROCESS_TEST_RESOURCES ) );
+        me.add( createMojoExecution( new Plugin(), "testCompile", "default-testCompile", TEST_COMPILE ) );
+        me.add( createMojoExecution( new Plugin(), "test", "default-test", TEST ) );
+        me.add( createMojoExecution( new Plugin(), "war", "default-war", PACKAGE ) );
+        me.add( createMojoExecution( new Plugin(), "install", "default-install", INSTALL ) );
+        final List<ExecutionPlanItem> executionPlanItem =
+            DefaultLifecyclesStub.createDefaultLifeCycles().createExecutionPlanItem(
+                ProjectDependencyGraphStub.A.getExecutionProject(), me );
+        return new MavenExecutionPlan( getScopes(), getScopes(), executionPlanItem );
+    }
+
+    public static MavenExecutionPlan getProjectBExecutionPlan()
+        throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException,
+        PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException,
+        NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException
+    {
+        List<MojoExecution> me = new ArrayList<MojoExecution>();
+        me.add( createMojoExecution( new Plugin(), "enforce", "enforce-versions", VALIDATE ) );
+        me.add( createMojoExecution( new Plugin(), "resources", "default-resources", PROCESS_RESOURCES ) );
+        me.add( createMojoExecution( new Plugin(), "compile", "default-compile", COMPILE ) );
+        me.add( createMojoExecution( new Plugin(), "testResources", "default-testResources", PROCESS_TEST_RESOURCES ) );
+        me.add( createMojoExecution( new Plugin(), "testCompile", "default-testCompile", TEST_COMPILE ) );
+        me.add( createMojoExecution( new Plugin(), "test", "default-test", TEST ) );
+        final List<ExecutionPlanItem> planItem =
+            DefaultLifecyclesStub.createDefaultLifeCycles().createExecutionPlanItem(
+                ProjectDependencyGraphStub.B.getExecutionProject(), me );
+        return new MavenExecutionPlan( getScopes(), getScopes(), planItem );
+    }
+
+    private static MojoExecution createMojoExecution( Plugin plugin, String goal, String executionId,
+                                                      MojoDescriptor mojoDescriptor )
+    {
+        MojoExecution result = new MojoExecution( plugin, goal, executionId );
+        result.setConfiguration( new Xpp3Dom( executionId + "-" + goal ) );
+        result.setMojoDescriptor( mojoDescriptor );
+        return result;
+
+    }
+
+    public static MojoDescriptor createMojoDescriptor( String phaseName )
+    {
+        final MojoDescriptor mojoDescriptor = new MojoDescriptor();
+        mojoDescriptor.setPhase( phaseName );
+        final PluginDescriptor descriptor = new PluginDescriptor();
+        descriptor.setArtifactId( "artifact." + phaseName );
+        mojoDescriptor.setPluginDescriptor( descriptor );
+        return mojoDescriptor;
+    }
+
+
+    public static Set<String> getScopes()
+    {
+        return new HashSet<String>( Arrays.asList( "compile" ) );
+    }
+
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.lifecycle.internal.GoalTask;
+import org.apache.maven.lifecycle.internal.LifecycleTask;
+import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator;
+import org.apache.maven.lifecycle.internal.TaskSegment;
+import org.apache.maven.plugin.InvalidPluginDescriptorException;
+import org.apache.maven.plugin.MojoNotFoundException;
+import org.apache.maven.plugin.PluginDescriptorParsingException;
+import org.apache.maven.plugin.PluginNotFoundException;
+import org.apache.maven.plugin.PluginResolutionException;
+import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
+import org.apache.maven.plugin.version.PluginVersionResolutionException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Kristian Rosenvold
+ */
+
+public class LifecycleTaskSegmentCalculatorStub
+    implements LifecycleTaskSegmentCalculator
+{
+    public static final String clean = "clean";
+
+    public static final String aggr = "aggr";
+
+    public static final String install = "install";
+
+    public List<TaskSegment> calculateTaskSegments( MavenSession session, List<String> tasks )
+        throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
+        MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
+        PluginVersionResolutionException
+    {
+        List<TaskSegment> taskSegments = new ArrayList<TaskSegment>( tasks.size() );
+
+        TaskSegment currentSegment = null;
+
+        for ( String task : tasks )
+        {
+            if ( aggr.equals( task ) )
+            {
+                boolean aggregating = true;
+
+                if ( currentSegment == null || currentSegment.isAggregating() != aggregating )
+                {
+                    currentSegment = new TaskSegment( aggregating );
+                    taskSegments.add( currentSegment );
+                }
+
+                currentSegment.getTasks().add( new GoalTask( task ) );
+            }
+            else
+            {
+                // lifecycle phase
+                if ( currentSegment == null || currentSegment.isAggregating() )
+                {
+                    currentSegment = new TaskSegment( false );
+                    taskSegments.add( currentSegment );
+                }
+                currentSegment.getTasks().add( new LifecycleTask( task ) );
+            }
+        }
+
+        return taskSegments;
+    }
+
+    public boolean requiresProject( MavenSession session )
+    {
+        return true;
+    }
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.codehaus.plexus.logging.Logger;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class LoggerStub
+    implements Logger
+{
+    public void debug( String s )
+    {
+    }
+
+    public void debug( String s, Throwable throwable )
+    {
+    }
+
+    public boolean isDebugEnabled()
+    {
+        return true;
+    }
+
+    public void info( String s )
+    {
+    }
+
+    public void info( String s, Throwable throwable )
+    {
+    }
+
+    public boolean isInfoEnabled()
+    {
+        return true;
+    }
+
+    public void warn( String s )
+    {
+    }
+
+    public void warn( String s, Throwable throwable )
+    {
+    }
+
+    public boolean isWarnEnabled()
+    {
+        return true;
+    }
+
+    public void error( String s )
+    {
+    }
+
+    public void error( String s, Throwable throwable )
+    {
+    }
+
+    public boolean isErrorEnabled()
+    {
+        return true;
+    }
+
+    public void fatalError( String s )
+    {
+    }
+
+    public void fatalError( String s, Throwable throwable )
+    {
+    }
+
+    public boolean isFatalErrorEnabled()
+    {
+        return true;
+    }
+
+    public Logger getChildLogger( String s )
+    {
+        return null;
+    }
+
+    public int getThreshold()
+    {
+        return 0;
+    }
+
+    public void setThreshold( int i )
+    {
+
+    }
+
+    public String getName()
+    {
+        return "StubLogger";
+    }
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.lifecycle.LifecycleExecutionException;
+import org.apache.maven.lifecycle.internal.DependencyContext;
+import org.apache.maven.lifecycle.internal.MojoExecutor;
+import org.apache.maven.lifecycle.internal.PhaseRecorder;
+import org.apache.maven.lifecycle.internal.ProjectIndex;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class MojoExecutorStub
+    extends MojoExecutor
+{ // This is being lazy instead of making interface
+
+    public List<MojoExecution> executions = Collections.synchronizedList( new ArrayList<MojoExecution>() );
+
+    @Override
+    public void execute( MavenSession session, MojoExecution mojoExecution, ProjectIndex projectIndex,
+                         DependencyContext dependencyContext, PhaseRecorder phaseRecorder )
+        throws LifecycleExecutionException
+    {
+        executions.add( mojoExecution );
+    }
+
+    @Override
+    public void execute( MavenSession session, List<MojoExecution> mojoExecutions, ProjectIndex projectIndex,
+                         DependencyContext dependencyContext )
+        throws LifecycleExecutionException
+    {
+        for ( MojoExecution mojoExecution : mojoExecutions )
+        {
+            executions.add( mojoExecution );
+        }
+    }
+
+
+    public static MojoDescriptor createMojoDescriptor( String mojoDescription )
+    {
+        final PluginDescriptor descriptor = new PluginDescriptor();
+        descriptor.setArtifactId( mojoDescription );
+        final MojoDescriptor mojoDescriptor = new MojoDescriptor();
+        mojoDescriptor.setDescription( mojoDescription );
+        mojoDescriptor.setPluginDescriptor( descriptor );
+        return mojoDescriptor;
+    }
+
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
+import org.apache.maven.plugin.prefix.PluginPrefixRequest;
+import org.apache.maven.plugin.prefix.PluginPrefixResolver;
+import org.apache.maven.plugin.prefix.PluginPrefixResult;
+
+/**
+ * @author Kristian Rosenvold
+ */
+
+public class PluginPrefixResolverStub
+    implements PluginPrefixResolver
+{
+    public PluginPrefixResult resolve( PluginPrefixRequest request )
+        throws NoPluginFoundForPrefixException
+    {
+        return new PluginPrefixResult()
+        {
+            public String getGroupId()
+            {
+                return "com.foobar";
+            }
+
+            public String getArtifactId()
+            {
+                return "bazbaz";
+            }
+
+            public ArtifactRepository getRepository()
+            {
+                return null;
+            }
+        };
+    }
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugin.version.PluginVersionRequest;
+import org.apache.maven.plugin.version.PluginVersionResolutionException;
+import org.apache.maven.plugin.version.PluginVersionResolver;
+import org.apache.maven.plugin.version.PluginVersionResult;
+
+/**
+ * @author Kristian Rosenvold
+ */
+
+public class PluginVersionResolverStub
+    implements PluginVersionResolver
+{
+
+    public PluginVersionResult resolve( PluginVersionRequest request )
+        throws PluginVersionResolutionException
+    {
+        return new PluginVersionResult()
+        {
+            public String getVersion()
+            {
+                return "0.42";
+            }
+
+            public ArtifactRepository getRepository()
+            {
+                return null;
+            }
+        };
+    }
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.apache.maven.ProjectDependenciesResolver;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class ProjectDependenciesResolverStub
+    implements ProjectDependenciesResolver
+{
+    public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToResolve, MavenSession session )
+        throws ArtifactResolutionException, ArtifactNotFoundException
+    {
+        return new HashSet<Artifact>();
+    }
+
+    public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect,
+                                  Collection<String> scopesToResolve, MavenSession session )
+        throws ArtifactResolutionException, ArtifactNotFoundException
+    {
+        return new HashSet<Artifact>();
+    }
+
+    public Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes,
+                                  MavenSession session )
+        throws ArtifactResolutionException, ArtifactNotFoundException
+    {
+        return new HashSet<Artifact>();
+    }
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,226 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import org.apache.maven.execution.AbstractExecutionListener;
+import org.apache.maven.execution.DefaultMavenExecutionRequest;
+import org.apache.maven.execution.DefaultMavenExecutionResult;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.execution.ProjectDependencyGraph;
+import org.apache.maven.lifecycle.LifecycleNotFoundException;
+import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException;
+import org.apache.maven.lifecycle.internal.GoalTask;
+import org.apache.maven.lifecycle.internal.ProjectBuildList;
+import org.apache.maven.lifecycle.internal.ProjectSegment;
+import org.apache.maven.lifecycle.internal.TaskSegment;
+import org.apache.maven.plugin.InvalidPluginDescriptorException;
+import org.apache.maven.plugin.MojoNotFoundException;
+import org.apache.maven.plugin.PluginDescriptorParsingException;
+import org.apache.maven.plugin.PluginNotFoundException;
+import org.apache.maven.plugin.PluginResolutionException;
+import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException;
+import org.apache.maven.plugin.version.PluginVersionResolutionException;
+import org.apache.maven.project.MavenProject;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A stub dependency graph that is custom made for testing concurrent build graph evaluations.
+ * <p/>
+ * Implements a graph as follows:
+ * A has no dependencies
+ * B depends on A
+ * C depends on A
+ * X depends on B & C
+ * Y depends on B
+ * Z depends on C
+ *
+ * @author Kristian Rosenvold
+ */
+public class ProjectDependencyGraphStub
+    implements ProjectDependencyGraph
+{
+    public static final MavenProject A = new MavenProject();
+
+    public static final MavenProject B = new MavenProject();
+
+    public static final MavenProject C = new MavenProject();
+
+    public static final MavenProject X = new MavenProject();
+
+    public static final MavenProject Y = new MavenProject();
+
+    public static final MavenProject Z = new MavenProject();
+
+    public static final MavenProject UNKNOWN = new MavenProject();
+
+    static
+    {
+        A.setArtifactId( "A" );
+        B.setArtifactId( "B" );
+        C.setArtifactId( "C" );
+        X.setArtifactId( "X" );
+        Y.setArtifactId( "Y" );
+        Z.setArtifactId( "Z" );
+    }
+
+    // This should probably be moved to a separate stub
+
+    public static ProjectBuildList getProjectBuildList( MavenSession session )
+        throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
+        NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException,
+        LifecyclePhaseNotFoundException, LifecycleNotFoundException
+    {
+        final List<ProjectSegment> list = getProjectBuilds( session );
+        return new ProjectBuildList( list );
+
+    }
+
+    public static List<ProjectSegment> getProjectBuilds( MavenSession session )
+        throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
+        NoPluginFoundForPrefixException, PluginNotFoundException, MojoNotFoundException, PluginResolutionException,
+        LifecyclePhaseNotFoundException, LifecycleNotFoundException
+    {
+        List<ProjectSegment> projectBuilds = new ArrayList<ProjectSegment>();
+
+        TaskSegment segment = createTaskSegment();
+        projectBuilds.add( createProjectBuild( A, session, segment ) );
+        projectBuilds.add( createProjectBuild( B, session, segment ) );
+        projectBuilds.add( createProjectBuild( C, session, segment ) );
+        projectBuilds.add( createProjectBuild( X, session, segment ) );
+        projectBuilds.add( createProjectBuild( Y, session, segment ) );
+        projectBuilds.add( createProjectBuild( Z, session, segment ) );
+        return projectBuilds;
+    }
+
+    private static ProjectSegment createProjectBuild( MavenProject project, MavenSession session,
+                                                      TaskSegment taskSegment )
+        throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
+        NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException,
+        LifecyclePhaseNotFoundException, LifecycleNotFoundException
+    {
+        final MavenSession session1 = session.clone();
+        return new ProjectSegment( project, taskSegment, session1 );
+    }
+
+
+    private static TaskSegment createTaskSegment()
+    {
+        TaskSegment result = new TaskSegment( false );
+        result.getTasks().add( new GoalTask( "t1" ) );
+        result.getTasks().add( new GoalTask( "t2" ) );
+        return result;
+    }
+
+    class Dependency
+    {
+        MavenProject dependant;
+
+        MavenProject dependency;
+
+        Dependency( MavenProject dependant, MavenProject dependency )
+        {
+            this.dependant = dependant;
+            this.dependency = dependency;
+        }
+
+        void addIfDownstream( MavenProject mavenProject, List<MavenProject> result )
+        {
+            if ( dependency == mavenProject )
+            {
+                result.add( dependant );
+            }
+        }
+
+        void addIfUpstreamOf( MavenProject mavenProject, List<MavenProject> result )
+        {
+            if ( dependant == mavenProject )
+            {
+                result.add( dependency ); // All projects are the statics from this class
+            }
+        }
+    }
+
+    private List<Dependency> getDependencies()
+    {
+        List<Dependency> dependencies = new ArrayList<Dependency>();
+        dependencies.add( new Dependency( B, A ) );
+        dependencies.add( new Dependency( C, A ) );
+        dependencies.add( new Dependency( X, B ) );
+        dependencies.add( new Dependency( X, C ) );
+        dependencies.add( new Dependency( Y, B ) );
+        dependencies.add( new Dependency( Z, C ) );
+        return dependencies;
+    }
+
+    public List<MavenProject> getSortedProjects()
+    {
+        return Arrays.asList( A, B, C, X, Y, Z ); // I'm not entirely sure about the order but this shold do...
+    }
+
+    public List<MavenProject> getDownstreamProjects( MavenProject project, boolean transitive )
+    {
+        if ( transitive )
+        {
+            throw new RuntimeException( "Not implemented yet" );
+        }
+        List<MavenProject> result = new ArrayList<MavenProject>();
+        for ( Dependency dependency : getDependencies() )
+        {
+            dependency.addIfDownstream( project, result );
+        }
+        return result;
+    }
+
+    public List<MavenProject> getUpstreamProjects( MavenProject project, boolean transitive )
+    {
+        if ( transitive )
+        {
+            throw new RuntimeException( "Not implemented yet" );
+        }
+        List<MavenProject> result = new ArrayList<MavenProject>();
+        final List<Dependency> dependencies = getDependencies();
+        for ( Dependency dependency : dependencies )
+        {
+            dependency.addIfUpstreamOf( project, result );
+        }
+        return result;
+    }
+
+    public static MavenSession getMavenSession( MavenProject mavenProject )
+    {
+        final MavenSession session = getMavenSession();
+        session.setCurrentProject( mavenProject );
+        return session;
+    }
+
+    public static MavenSession getMavenSession()
+    {
+        final DefaultMavenExecutionResult defaultMavenExecutionResult = new DefaultMavenExecutionResult();
+        MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest();
+        mavenExecutionRequest.setExecutionListener( new AbstractExecutionListener() );
+        mavenExecutionRequest.setGoals( Arrays.asList( "clean", "aggr", "install" ) );
+        final MavenSession session = new MavenSession( null, mavenExecutionRequest, defaultMavenExecutionResult );
+        final ProjectDependencyGraphStub dependencyGraphStub = new ProjectDependencyGraphStub();
+        session.setProjectDependencyGraph( dependencyGraphStub );
+        session.setProjects( dependencyGraphStub.getSortedProjects() );
+        return session;
+    }
+
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java?rev=931884&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java (added)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java Thu Apr  8 11:29:07 2010
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.lifecycle.internal.stub;
+
+import junit.framework.TestCase;
+import org.apache.maven.project.MavenProject;
+
+import java.util.List;
+
+
+/**
+ * Tests the stub. Yeah, I know.
+ *
+ * @author Kristian Rosenvold
+ */
+
+public class ProjectDependencyGraphStubTest
+    extends TestCase
+{
+    public void testADependencies()
+    {
+        ProjectDependencyGraphStub stub = new ProjectDependencyGraphStub();
+        final List<MavenProject> mavenProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.A, false );
+        assertEquals( 0, mavenProjects.size() );
+    }
+
+    public void testBDepenencies( ProjectDependencyGraphStub stub )
+    {
+        final List<MavenProject> bProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.B, false );
+        assertEquals( 1, bProjects.size() );
+        assertTrue( bProjects.contains( ProjectDependencyGraphStub.A ) );
+    }
+
+    public void testCDepenencies( ProjectDependencyGraphStub stub )
+    {
+        final List<MavenProject> cProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.C, false );
+        assertEquals( 1, cProjects.size() );
+        assertTrue( cProjects.contains( ProjectDependencyGraphStub.C ) );
+    }
+
+    public void testXDepenencies( ProjectDependencyGraphStub stub )
+    {
+        final List<MavenProject> cProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.X, false );
+        assertEquals( 2, cProjects.size() );
+        assertTrue( cProjects.contains( ProjectDependencyGraphStub.C ) );
+        assertTrue( cProjects.contains( ProjectDependencyGraphStub.B ) );
+    }
+}

Propchange: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java?rev=931884&r1=931883&r2=931884&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java (original)
+++ maven/maven-3/trunk/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java Thu Apr  8 11:29:07 2010
@@ -55,7 +55,7 @@ public class EmptyLifecycleExecutor
         throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
         MojoNotFoundException
     {
-        return new MavenExecutionPlan( Collections.<MojoExecution> emptyList(), null, null );
+        return new MavenExecutionPlan(null, null, null );
     }
 
     public void execute( MavenSession session )

Modified: maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java?rev=931884&r1=931883&r2=931884&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java (original)
+++ maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java Thu Apr  8 11:29:07 2010
@@ -98,6 +98,8 @@ public class CLIManager
 
     public static final String ENCRYPT_PASSWORD = "ep";
 
+    public static final String THREADS = "T";
+
     private Options options;
 
     @SuppressWarnings("static-access")
@@ -136,7 +138,8 @@ public class CLIManager
         options.addOption( OptionBuilder.withLongOpt( "show-version" ).withDescription( "Display version information WITHOUT stopping build" ).create( SHOW_VERSION ) );
         options.addOption( OptionBuilder.withLongOpt( "encrypt-master-password" ).hasArg().withDescription( "Encrypt master security password" ).create( ENCRYPT_MASTER_PASSWORD ) );
         options.addOption( OptionBuilder.withLongOpt( "encrypt-password" ).hasArg().withDescription( "Encrypt server password" ).create( ENCRYPT_PASSWORD ) );
-        
+        options.addOption( OptionBuilder.withLongOpt( "threads" ).hasArg().withDescription( "Thread count, for instance 2.0C where C is core multiplied" ).create( THREADS ) );
+
         // Adding this back in for compatibility with the verifier that hard codes this option.
         
         options.addOption( OptionBuilder.withLongOpt( "no-plugin-registry" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "npr" ) );

Modified: maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java?rev=931884&r1=931883&r2=931884&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java (original)
+++ maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java Thu Apr  8 11:29:07 2010
@@ -202,7 +202,9 @@ class ExecutionEventLogger
 
         long time = finish.getTime() - session.getRequest().getStartTime().getTime();
 
-        logger.info( "Total time: " + getFormattedTime( time ) );
+        String wallClock = session.getRequest().isThreadConfigurationPresent() ? " (Wall Clock)" : "";
+
+        logger.info( "Total time: " + getFormattedTime( time ) + wallClock);
 
         logger.info( "Finished at: " + finish );
 

Modified: maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=931884&r1=931883&r2=931884&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java (original)
+++ maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java Thu Apr  8 11:29:07 2010
@@ -37,6 +37,7 @@ import org.apache.maven.execution.MavenE
 import org.apache.maven.execution.MavenExecutionRequestPopulator;
 import org.apache.maven.execution.MavenExecutionResult;
 import org.apache.maven.lifecycle.LifecycleExecutionException;
+import org.apache.maven.lifecycle.internal.LifecycleWeaveBuilder;
 import org.apache.maven.model.building.ModelProcessor;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.properties.internal.EnvironmentUtils;
@@ -69,6 +70,8 @@ public class MavenCli
 {
     public static final String LOCAL_REPO_PROPERTY = "maven.repo.local";
 
+    public static final String THREADS_DEPRECATED = "maven.threads.experimental";
+
     public static final String userHome = System.getProperty( "user.home" );
 
     public static final File userMavenConfigurationHome = new File( userHome, ".m2" );
@@ -863,6 +866,21 @@ public class MavenCli
             request.setLocalRepositoryPath( localRepoProperty );
         }
 
+
+        final String threadConfiguration = commandLine.hasOption( CLIManager.THREADS ) ?
+                commandLine.getOptionValue( CLIManager.THREADS) :
+                request.getSystemProperties().getProperty(MavenCli.THREADS_DEPRECATED); // TODO: Remove this setting. Note that the int-tests use it
+
+        if (threadConfiguration != null){
+            request.setPerCoreThreadCount( threadConfiguration.contains("C"));
+            if (threadConfiguration.contains("W"))
+            {
+                LifecycleWeaveBuilder.setWeaveMode(request.getUserProperties());
+            }
+            request.setThreadCount(threadConfiguration.replace("C", "").replace("W", "").replace("auto", ""));
+        }
+
+
         return request;
     }
 



Mime
View raw message