mirror of https://github.com/apache/maven.git
parent
a0c1bf3c04
commit
b877445cb9
|
@ -131,6 +131,11 @@ under the License.
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-jxpath</groupId>
|
<groupId>commons-jxpath</groupId>
|
||||||
<artifactId>commons-jxpath</artifactId>
|
<artifactId>commons-jxpath</artifactId>
|
||||||
|
|
|
@ -22,6 +22,7 @@ package org.apache.maven;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
@ -45,37 +46,39 @@ import org.apache.maven.project.ProjectBuildingRequest;
|
||||||
import org.apache.maven.repository.RepositorySystem;
|
import org.apache.maven.repository.RepositorySystem;
|
||||||
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
||||||
import org.codehaus.plexus.ContainerConfiguration;
|
import org.codehaus.plexus.ContainerConfiguration;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusConstants;
|
import org.codehaus.plexus.PlexusConstants;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
|
||||||
import org.codehaus.plexus.util.FileUtils;
|
import org.codehaus.plexus.util.FileUtils;
|
||||||
import org.eclipse.aether.DefaultRepositorySystemSession;
|
import org.eclipse.aether.DefaultRepositorySystemSession;
|
||||||
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
||||||
import org.eclipse.aether.repository.LocalRepository;
|
import org.eclipse.aether.repository.LocalRepository;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
public abstract class AbstractCoreMavenComponentTestCase
|
public abstract class AbstractCoreMavenComponentTestCase
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
protected RepositorySystem repositorySystem;
|
protected RepositorySystem repositorySystem;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
protected org.apache.maven.project.ProjectBuilder projectBuilder;
|
protected org.apache.maven.project.ProjectBuilder projectBuilder;
|
||||||
|
|
||||||
protected void setUp()
|
@Override
|
||||||
throws Exception
|
protected void setUp() throws Exception
|
||||||
{
|
{
|
||||||
repositorySystem = lookup( RepositorySystem.class );
|
super.setUp();
|
||||||
projectBuilder = lookup( org.apache.maven.project.ProjectBuilder.class );
|
getContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown()
|
protected synchronized void setupContainer()
|
||||||
throws Exception
|
|
||||||
{
|
{
|
||||||
repositorySystem = null;
|
super.setupContainer();
|
||||||
projectBuilder = null;
|
|
||||||
super.tearDown();
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected String getProjectsDirectory();
|
abstract protected String getProjectsDirectory();
|
||||||
|
|
|
@ -1,17 +1,5 @@
|
||||||
package org.apache.maven;
|
package org.apache.maven;
|
||||||
|
|
||||||
import org.apache.maven.artifact.Artifact;
|
|
||||||
import org.apache.maven.artifact.DefaultArtifact;
|
|
||||||
import org.apache.maven.execution.MavenExecutionRequest;
|
|
||||||
import org.apache.maven.execution.MavenExecutionResult;
|
|
||||||
import org.apache.maven.project.MavenProject;
|
|
||||||
import org.apache.maven.project.MavenProjectHelper;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
|
|
||||||
import static java.util.Arrays.asList;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -30,14 +18,31 @@ import static java.util.Arrays.asList;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.maven.artifact.Artifact;
|
||||||
|
import org.apache.maven.artifact.DefaultArtifact;
|
||||||
|
import org.apache.maven.execution.MavenExecutionRequest;
|
||||||
|
import org.apache.maven.execution.MavenExecutionResult;
|
||||||
|
import org.apache.maven.project.MavenProject;
|
||||||
|
import org.apache.maven.project.MavenProjectHelper;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static java.util.Arrays.asList;
|
||||||
|
|
||||||
public class DefaultMavenTest
|
public class DefaultMavenTest
|
||||||
extends AbstractCoreMavenComponentTestCase
|
extends AbstractCoreMavenComponentTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Maven maven;
|
||||||
|
|
||||||
public void testThatErrorDuringProjectDependencyGraphCreationAreStored()
|
public void testThatErrorDuringProjectDependencyGraphCreationAreStored()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
Maven maven = getContainer().lookup( Maven.class );
|
|
||||||
MavenExecutionRequest request = createMavenExecutionRequest( getProject( "cyclic-reference" ) ).setGoals( asList("validate") );
|
MavenExecutionRequest request = createMavenExecutionRequest( getProject( "cyclic-reference" ) ).setGoals( asList("validate") );
|
||||||
|
|
||||||
MavenExecutionResult result = maven.execute( request );
|
MavenExecutionResult result = maven.execute( request );
|
||||||
|
|
|
@ -17,32 +17,31 @@ package org.apache.maven;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.maven.exception.ExceptionHandler;
|
import org.apache.maven.exception.ExceptionHandler;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
import org.apache.maven.exception.ExceptionSummary;
|
||||||
|
import org.apache.maven.execution.MavenExecutionRequest;
|
||||||
|
import org.apache.maven.execution.MavenExecutionResult;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class MavenTest
|
public class MavenTest
|
||||||
extends AbstractCoreMavenComponentTestCase
|
extends AbstractCoreMavenComponentTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
private Maven maven;
|
private Maven maven;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private ExceptionHandler exceptionHandler;
|
private ExceptionHandler exceptionHandler;
|
||||||
|
|
||||||
protected void setUp()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
super.setUp();
|
|
||||||
maven = lookup( Maven.class );
|
|
||||||
exceptionHandler = lookup( ExceptionHandler.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown()
|
protected synchronized void setupContainer()
|
||||||
throws Exception
|
|
||||||
{
|
{
|
||||||
maven = null;
|
super.setupContainer();
|
||||||
exceptionHandler = null;
|
|
||||||
super.tearDown();
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getProjectsDirectory()
|
protected String getProjectsDirectory()
|
||||||
|
@ -53,7 +52,7 @@ public class MavenTest
|
||||||
public void testLifecycleExecutionUsingADefaultLifecyclePhase()
|
public void testLifecycleExecutionUsingADefaultLifecyclePhase()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
File pom = getProject( "project-with-additional-lifecycle-elements" );
|
File pom = getProject( "project-with-additional-lifecycle-elements" );
|
||||||
MavenExecutionRequest request = createMavenExecutionRequest( pom );
|
MavenExecutionRequest request = createMavenExecutionRequest( pom );
|
||||||
MavenExecutionResult result = maven.execute( request );
|
MavenExecutionResult result = maven.execute( request );
|
||||||
|
@ -64,6 +63,6 @@ public class MavenTest
|
||||||
es.getException().printStackTrace();
|
es.getException().printStackTrace();
|
||||||
fail( "Maven did not execute correctly." );
|
fail( "Maven did not execute correctly." );
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,29 +27,15 @@ import java.util.Set;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.execution.MavenSession;
|
import org.apache.maven.execution.MavenSession;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
public class ProjectDependenciesResolverTest
|
public class ProjectDependenciesResolverTest
|
||||||
extends AbstractCoreMavenComponentTestCase
|
extends AbstractCoreMavenComponentTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
private ProjectDependenciesResolver resolver;
|
private ProjectDependenciesResolver resolver;
|
||||||
|
|
||||||
protected void setUp()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
super.setUp();
|
|
||||||
resolver = lookup( ProjectDependenciesResolver.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void tearDown()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
resolver = null;
|
|
||||||
super.tearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getProjectsDirectory()
|
protected String getProjectsDirectory()
|
||||||
{
|
{
|
||||||
return "src/test/projects/project-dependencies-resolver";
|
return "src/test/projects/project-dependencies-resolver";
|
||||||
|
|
|
@ -27,9 +27,13 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.codehaus.plexus.ContainerConfiguration;
|
import org.codehaus.plexus.ContainerConfiguration;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusConstants;
|
import org.codehaus.plexus.PlexusConstants;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
|
@ -38,7 +42,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
||||||
public class DefaultLifecyclesTest
|
public class DefaultLifecyclesTest
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
private DefaultLifecycles defaultLifeCycles;
|
private DefaultLifecycles defaultLifeCycles;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,19 +53,20 @@ public class DefaultLifecyclesTest
|
||||||
configuration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
|
configuration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setUp()
|
@Override
|
||||||
throws Exception
|
protected void setUp() throws Exception
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
defaultLifeCycles = lookup( DefaultLifecycles.class );
|
getContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown()
|
protected synchronized void setupContainer()
|
||||||
throws Exception
|
|
||||||
{
|
{
|
||||||
defaultLifeCycles = null;
|
super.setupContainer();
|
||||||
super.tearDown();
|
|
||||||
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDefaultLifecycles()
|
public void testDefaultLifecycles()
|
||||||
|
|
|
@ -23,10 +23,11 @@ import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
|
||||||
import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder;
|
import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder;
|
||||||
import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator;
|
import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator;
|
||||||
import org.apache.maven.lifecycle.internal.MojoExecutor;
|
import org.apache.maven.lifecycle.internal.MojoExecutor;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Just asserts that it's able to create those components. Handy when plexus gets a nervous breakdown.
|
* Just asserts that it's able to create those components. Handy when CDI container gets a nervous breakdown.
|
||||||
*
|
*
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
|
@ -34,49 +35,29 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
||||||
public class LifecycleExecutorSubModulesTest
|
public class LifecycleExecutorSubModulesTest
|
||||||
extends AbstractCoreMavenComponentTestCase
|
extends AbstractCoreMavenComponentTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
private DefaultLifecycles defaultLifeCycles;
|
private DefaultLifecycles defaultLifeCycles;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private MojoExecutor mojoExecutor;
|
private MojoExecutor mojoExecutor;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private LifecycleModuleBuilder lifeCycleBuilder;
|
private LifecycleModuleBuilder lifeCycleBuilder;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private LifecycleDependencyResolver lifeCycleDependencyResolver;
|
private LifecycleDependencyResolver lifeCycleDependencyResolver;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
|
private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
|
private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private LifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
|
private LifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
|
||||||
|
|
||||||
|
@Inject
|
||||||
protected void setUp()
|
private ExceptionHandler exceptionHandler;
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
super.setUp();
|
|
||||||
defaultLifeCycles = lookup( DefaultLifecycles.class );
|
|
||||||
mojoExecutor = lookup( MojoExecutor.class );
|
|
||||||
lifeCycleBuilder = lookup( LifecycleModuleBuilder.class );
|
|
||||||
lifeCycleDependencyResolver = lookup( LifecycleDependencyResolver.class );
|
|
||||||
lifeCycleExecutionPlanCalculator = lookup( LifecycleExecutionPlanCalculator.class );
|
|
||||||
lifeCyclePluginAnalyzer = lookup( LifeCyclePluginAnalyzer.class );
|
|
||||||
lifeCycleTaskSegmentCalculator = lookup( LifecycleTaskSegmentCalculator.class );
|
|
||||||
lookup( ExceptionHandler.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void tearDown()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
defaultLifeCycles = null;
|
|
||||||
super.tearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getProjectsDirectory()
|
protected String getProjectsDirectory()
|
||||||
{
|
{
|
||||||
|
@ -93,6 +74,7 @@ public class LifecycleExecutorSubModulesTest
|
||||||
assertNotNull( lifeCycleExecutionPlanCalculator );
|
assertNotNull( lifeCycleExecutionPlanCalculator );
|
||||||
assertNotNull( lifeCyclePluginAnalyzer );
|
assertNotNull( lifeCyclePluginAnalyzer );
|
||||||
assertNotNull( lifeCycleTaskSegmentCalculator );
|
assertNotNull( lifeCycleTaskSegmentCalculator );
|
||||||
|
assertNotNull( exceptionHandler );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -26,7 +26,6 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.AbstractCoreMavenComponentTestCase;
|
import org.apache.maven.AbstractCoreMavenComponentTestCase;
|
||||||
import org.apache.maven.exception.ExceptionHandler;
|
|
||||||
import org.apache.maven.execution.MavenSession;
|
import org.apache.maven.execution.MavenSession;
|
||||||
import org.apache.maven.execution.MojoExecutionEvent;
|
import org.apache.maven.execution.MojoExecutionEvent;
|
||||||
import org.apache.maven.execution.MojoExecutionListener;
|
import org.apache.maven.execution.MojoExecutionListener;
|
||||||
|
@ -37,7 +36,6 @@ import org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator
|
||||||
import org.apache.maven.lifecycle.internal.ExecutionPlanItem;
|
import org.apache.maven.lifecycle.internal.ExecutionPlanItem;
|
||||||
import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
|
import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
|
||||||
import org.apache.maven.lifecycle.internal.LifecycleTask;
|
import org.apache.maven.lifecycle.internal.LifecycleTask;
|
||||||
import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator;
|
|
||||||
import org.apache.maven.lifecycle.internal.MojoDescriptorCreator;
|
import org.apache.maven.lifecycle.internal.MojoDescriptorCreator;
|
||||||
import org.apache.maven.lifecycle.internal.TaskSegment;
|
import org.apache.maven.lifecycle.internal.TaskSegment;
|
||||||
import org.apache.maven.model.Plugin;
|
import org.apache.maven.model.Plugin;
|
||||||
|
@ -46,45 +44,25 @@ import org.apache.maven.plugin.MojoExecutionException;
|
||||||
import org.apache.maven.plugin.MojoNotFoundException;
|
import org.apache.maven.plugin.MojoNotFoundException;
|
||||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
|
||||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
public class LifecycleExecutorTest
|
public class LifecycleExecutorTest
|
||||||
extends AbstractCoreMavenComponentTestCase
|
extends AbstractCoreMavenComponentTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
private DefaultLifecycleExecutor lifecycleExecutor;
|
private DefaultLifecycleExecutor lifecycleExecutor;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private DefaultLifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
|
private DefaultLifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
|
private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator;
|
||||||
|
|
||||||
@Requirement
|
@Inject
|
||||||
private MojoDescriptorCreator mojoDescriptorCreator;
|
private MojoDescriptorCreator mojoDescriptorCreator;
|
||||||
|
|
||||||
|
|
||||||
protected void setUp()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
super.setUp();
|
|
||||||
lifecycleExecutor = (DefaultLifecycleExecutor) lookup( LifecycleExecutor.class );
|
|
||||||
lifeCycleTaskSegmentCalculator =
|
|
||||||
(DefaultLifecycleTaskSegmentCalculator) lookup( LifecycleTaskSegmentCalculator.class );
|
|
||||||
lifeCycleExecutionPlanCalculator = lookup( LifecycleExecutionPlanCalculator.class );
|
|
||||||
mojoDescriptorCreator = lookup( MojoDescriptorCreator.class );
|
|
||||||
lookup( ExceptionHandler.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void tearDown()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
lifecycleExecutor = null;
|
|
||||||
super.tearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getProjectsDirectory()
|
protected String getProjectsDirectory()
|
||||||
{
|
{
|
||||||
return "src/test/projects/lifecycle-executor";
|
return "src/test/projects/lifecycle-executor";
|
||||||
|
|
|
@ -30,12 +30,12 @@ import org.apache.maven.AbstractCoreMavenComponentTestCase;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.execution.MavenSession;
|
import org.apache.maven.execution.MavenSession;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
|
||||||
import org.junit.Test;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
public class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentTestCase
|
public class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
private LifecycleDependencyResolver resolver;
|
private LifecycleDependencyResolver resolver;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,15 +44,6 @@ public class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentT
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
super.setUp();
|
|
||||||
resolver = lookup( LifecycleDependencyResolver.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCachedReactorProjectDependencies() throws Exception
|
public void testCachedReactorProjectDependencies() throws Exception
|
||||||
{
|
{
|
||||||
MavenSession session = createMavenSession( new File( "src/test/projects/lifecycle-dependency-resolver/pom.xml" ), new Properties(), true );
|
MavenSession session = createMavenSession( new File( "src/test/projects/lifecycle-dependency-resolver/pom.xml" ), new Properties(), true );
|
||||||
|
|
|
@ -31,29 +31,16 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
|
||||||
import org.codehaus.plexus.component.repository.ComponentDescriptor;
|
import org.codehaus.plexus.component.repository.ComponentDescriptor;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
public class PluginManagerTest
|
public class PluginManagerTest
|
||||||
extends AbstractCoreMavenComponentTestCase
|
extends AbstractCoreMavenComponentTestCase
|
||||||
{
|
{
|
||||||
@Requirement
|
@Inject
|
||||||
private DefaultBuildPluginManager pluginManager;
|
private DefaultBuildPluginManager pluginManager;
|
||||||
|
|
||||||
protected void setUp()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
super.setUp();
|
|
||||||
pluginManager = (DefaultBuildPluginManager) lookup( BuildPluginManager.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void tearDown()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
pluginManager = null;
|
|
||||||
super.tearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getProjectsDirectory()
|
protected String getProjectsDirectory()
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,8 @@ import org.codehaus.plexus.PlexusContainer;
|
||||||
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
|
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
|
||||||
import org.codehaus.plexus.util.dag.CycleDetectedException;
|
import org.codehaus.plexus.util.dag.CycleDetectedException;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
|
@ -55,15 +57,9 @@ public class PluginParameterExpressionEvaluatorTest
|
||||||
{
|
{
|
||||||
private static final String FS = File.separator;
|
private static final String FS = File.separator;
|
||||||
|
|
||||||
|
@Inject
|
||||||
private RepositorySystem factory;
|
private RepositorySystem factory;
|
||||||
|
|
||||||
public void setUp()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
super.setUp();
|
|
||||||
factory = lookup( RepositorySystem.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown()
|
protected void tearDown()
|
||||||
throws Exception
|
throws Exception
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
import org.apache.maven.model.building.ModelBuildingException;
|
import org.apache.maven.model.building.ModelBuildingException;
|
||||||
|
@ -28,10 +29,13 @@ import org.apache.maven.model.building.ModelProblem;
|
||||||
import org.apache.maven.repository.RepositorySystem;
|
import org.apache.maven.repository.RepositorySystem;
|
||||||
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
||||||
import org.codehaus.plexus.ContainerConfiguration;
|
import org.codehaus.plexus.ContainerConfiguration;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusConstants;
|
import org.codehaus.plexus.PlexusConstants;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.eclipse.aether.DefaultRepositorySystemSession;
|
import org.eclipse.aether.DefaultRepositorySystemSession;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
|
@ -40,6 +44,7 @@ public abstract class AbstractMavenProjectTestCase
|
||||||
{
|
{
|
||||||
protected ProjectBuilder projectBuilder;
|
protected ProjectBuilder projectBuilder;
|
||||||
|
|
||||||
|
@Inject
|
||||||
protected RepositorySystem repositorySystem;
|
protected RepositorySystem repositorySystem;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,6 +55,15 @@ public abstract class AbstractMavenProjectTestCase
|
||||||
containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
|
containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected synchronized void setupContainer()
|
||||||
|
{
|
||||||
|
super.setupContainer();
|
||||||
|
|
||||||
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
|
}
|
||||||
|
|
||||||
protected void setUp()
|
protected void setUp()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
@ -64,8 +78,6 @@ public abstract class AbstractMavenProjectTestCase
|
||||||
// default over to the main project builder...
|
// default over to the main project builder...
|
||||||
projectBuilder = lookup( ProjectBuilder.class );
|
projectBuilder = lookup( ProjectBuilder.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
repositorySystem = lookup( RepositorySystem.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,6 +22,7 @@ package org.apache.maven.project;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -34,12 +35,15 @@ import org.apache.maven.project.harness.PomTestWrapper;
|
||||||
import org.apache.maven.repository.RepositorySystem;
|
import org.apache.maven.repository.RepositorySystem;
|
||||||
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
||||||
import org.codehaus.plexus.ContainerConfiguration;
|
import org.codehaus.plexus.ContainerConfiguration;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusConstants;
|
import org.codehaus.plexus.PlexusConstants;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.eclipse.aether.DefaultRepositorySystemSession;
|
import org.eclipse.aether.DefaultRepositorySystemSession;
|
||||||
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
||||||
import org.eclipse.aether.repository.LocalRepository;
|
import org.eclipse.aether.repository.LocalRepository;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.Assert.assertNotEquals;
|
import static org.junit.Assert.assertNotEquals;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
|
@ -53,12 +57,23 @@ public class PomConstructionTest
|
||||||
|
|
||||||
private static String BASE_MIXIN_DIR = BASE_DIR + "/resources-mixins";
|
private static String BASE_MIXIN_DIR = BASE_DIR + "/resources-mixins";
|
||||||
|
|
||||||
|
@Inject
|
||||||
private DefaultProjectBuilder projectBuilder;
|
private DefaultProjectBuilder projectBuilder;
|
||||||
|
|
||||||
|
@Inject
|
||||||
private RepositorySystem repositorySystem;
|
private RepositorySystem repositorySystem;
|
||||||
|
|
||||||
private File testDirectory;
|
private File testDirectory;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected synchronized void setupContainer()
|
||||||
|
{
|
||||||
|
super.setupContainer();
|
||||||
|
|
||||||
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
|
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
|
||||||
{
|
{
|
||||||
|
@ -70,10 +85,9 @@ public class PomConstructionTest
|
||||||
protected void setUp()
|
protected void setUp()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
getContainer();
|
||||||
testDirectory = new File( getBasedir(), BASE_POM_DIR );
|
testDirectory = new File( getBasedir(), BASE_POM_DIR );
|
||||||
new File( getBasedir(), BASE_MIXIN_DIR );
|
new File( getBasedir(), BASE_MIXIN_DIR );
|
||||||
projectBuilder = (DefaultProjectBuilder) lookup( ProjectBuilder.class );
|
|
||||||
repositorySystem = lookup( RepositorySystem.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,20 +20,34 @@ package org.apache.maven.project.artifact;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.repository.RepositorySystem;
|
import org.apache.maven.repository.RepositorySystem;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
public class MavenMetadataSourceTest
|
public class MavenMetadataSourceTest
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
|
@Inject
|
||||||
private RepositorySystem repositorySystem;
|
private RepositorySystem repositorySystem;
|
||||||
|
|
||||||
protected void setUp()
|
@Override
|
||||||
throws Exception
|
protected synchronized void setupContainer()
|
||||||
|
{
|
||||||
|
super.setupContainer();
|
||||||
|
|
||||||
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
repositorySystem = lookup( RepositorySystem.class );
|
getContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,12 +21,18 @@ package org.apache.maven.rtinfo.internal;
|
||||||
|
|
||||||
import org.apache.maven.rtinfo.RuntimeInformation;
|
import org.apache.maven.rtinfo.RuntimeInformation;
|
||||||
import org.codehaus.plexus.ContainerConfiguration;
|
import org.codehaus.plexus.ContainerConfiguration;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusConstants;
|
import org.codehaus.plexus.PlexusConstants;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class DefaultRuntimeInformationTest
|
public class DefaultRuntimeInformationTest
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
|
@Inject
|
||||||
|
RuntimeInformation rtInfo;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void customizeContainerConfiguration(
|
protected void customizeContainerConfiguration(
|
||||||
|
@ -37,21 +43,30 @@ public class DefaultRuntimeInformationTest
|
||||||
configuration.setClassPathScanning(PlexusConstants.SCANNING_INDEX);
|
configuration.setClassPathScanning(PlexusConstants.SCANNING_INDEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetMavenVersion()
|
@Override
|
||||||
throws Exception
|
protected void setUp() throws Exception
|
||||||
{
|
{
|
||||||
RuntimeInformation rtInfo = lookup( RuntimeInformation.class );
|
super.setUp();
|
||||||
|
getContainer();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected synchronized void setupContainer()
|
||||||
|
{
|
||||||
|
super.setupContainer();
|
||||||
|
|
||||||
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testGetMavenVersion()
|
||||||
|
{
|
||||||
String mavenVersion = rtInfo.getMavenVersion();
|
String mavenVersion = rtInfo.getMavenVersion();
|
||||||
assertNotNull( mavenVersion );
|
assertNotNull( mavenVersion );
|
||||||
assertTrue( mavenVersion.length() > 0 );
|
assertTrue( mavenVersion.length() > 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIsMavenVersion()
|
public void testIsMavenVersion()
|
||||||
throws Exception
|
|
||||||
{
|
{
|
||||||
RuntimeInformation rtInfo = lookup( RuntimeInformation.class );
|
|
||||||
|
|
||||||
assertTrue( rtInfo.isMavenVersion( "2.0" ) );
|
assertTrue( rtInfo.isMavenVersion( "2.0" ) );
|
||||||
assertFalse( rtInfo.isMavenVersion( "9.9" ) );
|
assertFalse( rtInfo.isMavenVersion( "9.9" ) );
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,13 @@ import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
|
||||||
import org.apache.maven.model.Profile;
|
import org.apache.maven.model.Profile;
|
||||||
import org.apache.maven.project.DefaultProjectBuilder;
|
import org.apache.maven.project.DefaultProjectBuilder;
|
||||||
import org.apache.maven.project.DefaultProjectBuildingRequest;
|
import org.apache.maven.project.DefaultProjectBuildingRequest;
|
||||||
import org.apache.maven.project.ProjectBuilder;
|
|
||||||
import org.apache.maven.project.ProjectBuildingRequest;
|
import org.apache.maven.project.ProjectBuildingRequest;
|
||||||
import org.apache.maven.project.harness.PomTestWrapper;
|
import org.apache.maven.project.harness.PomTestWrapper;
|
||||||
import org.apache.maven.repository.RepositorySystem;
|
import org.apache.maven.repository.RepositorySystem;
|
||||||
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
||||||
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
|
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
|
||||||
import org.codehaus.plexus.ContainerConfiguration;
|
import org.codehaus.plexus.ContainerConfiguration;
|
||||||
|
import org.codehaus.plexus.DefaultPlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusConstants;
|
import org.codehaus.plexus.PlexusConstants;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.codehaus.plexus.util.ReaderFactory;
|
import org.codehaus.plexus.util.ReaderFactory;
|
||||||
|
@ -38,9 +38,11 @@ import org.eclipse.aether.DefaultRepositorySystemSession;
|
||||||
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
||||||
import org.eclipse.aether.repository.LocalRepository;
|
import org.eclipse.aether.repository.LocalRepository;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class PomConstructionWithSettingsTest
|
public class PomConstructionWithSettingsTest
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
|
@ -49,8 +51,10 @@ public class PomConstructionWithSettingsTest
|
||||||
|
|
||||||
private static final String BASE_POM_DIR = BASE_DIR + "/resources-settings";
|
private static final String BASE_POM_DIR = BASE_DIR + "/resources-settings";
|
||||||
|
|
||||||
|
@Inject
|
||||||
private DefaultProjectBuilder projectBuilder;
|
private DefaultProjectBuilder projectBuilder;
|
||||||
|
|
||||||
|
@Inject
|
||||||
private RepositorySystem repositorySystem;
|
private RepositorySystem repositorySystem;
|
||||||
|
|
||||||
private File testDirectory;
|
private File testDirectory;
|
||||||
|
@ -63,12 +67,20 @@ public class PomConstructionWithSettingsTest
|
||||||
containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
|
containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected synchronized void setupContainer()
|
||||||
|
{
|
||||||
|
super.setupContainer();
|
||||||
|
|
||||||
|
( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(),
|
||||||
|
binder -> binder.requestInjection( this ) );
|
||||||
|
}
|
||||||
|
|
||||||
protected void setUp()
|
protected void setUp()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
getContainer();
|
||||||
testDirectory = new File( getBasedir(), BASE_POM_DIR );
|
testDirectory = new File( getBasedir(), BASE_POM_DIR );
|
||||||
projectBuilder = (DefaultProjectBuilder) lookup( ProjectBuilder.class );
|
|
||||||
repositorySystem = lookup( RepositorySystem.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -386,15 +386,8 @@ public class MavenCliTest
|
||||||
super.customizeContainer(container);
|
super.customizeContainer(container);
|
||||||
container.addComponent(mock(Maven.class), "org.apache.maven.Maven");
|
container.addComponent(mock(Maven.class), "org.apache.maven.Maven");
|
||||||
|
|
||||||
((DefaultPlexusContainer)container).addPlexusInjector(Collections.<PlexusBeanModule>emptyList(),
|
( (DefaultPlexusContainer) container ).addPlexusInjector( Collections.emptyList(),
|
||||||
new Module()
|
binder -> binder.bind( EventSpyDispatcher.class ).toInstance( eventSpyDispatcherMock ) );
|
||||||
{
|
|
||||||
public void configure( final Binder binder )
|
|
||||||
{
|
|
||||||
binder.bind( EventSpyDispatcher.class ).toInstance( eventSpyDispatcherMock );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue