public MavenEnvironment(MavenSession aMavenSession, BuildPluginManager aBuildPluginManager, Log aLog, DependencyTreeBuilder aDependencyTreeBuilder, ArtifactRepository aLocalRepository, SecDispatcher aSecurityDispatcher, MavenProjectBuilder aProjectBuilder, LifecycleExecutor aLifecycleExecutor, ArtifactFactory aArtifactFactory, ArtifactMetadataSource aArtifactMetadataSource, ArtifactCollector aArtifactCollector, RuntimeInformation aRuntimeInformation, MojoExecution aExecution) { mavenSession = aMavenSession; buildPluginManager = aBuildPluginManager; log = aLog; dependencyTreeBuilder = aDependencyTreeBuilder; localRepository = aLocalRepository; securityDispatcher = aSecurityDispatcher; projectBuilder = aProjectBuilder; lifecycleExecutor = aLifecycleExecutor; artifactFactory = aArtifactFactory; artifactMetadataSource = aArtifactMetadataSource; artifactCollector = aArtifactCollector; runtimeInformation = aRuntimeInformation; mojoExecution = aExecution; }
public SetupsMojoTestHelper( AbstractSetupsMojo mojo ) throws IOException { this.workingDir = new File( System.getProperty( "java.io.tmpdir" ), "unit_test_working" ); this.mojo = mojo; this.mojo.workingDir = this.workingDir.getCanonicalPath(); this.mojo.root = FitNesseHelper.DEFAULT_ROOT; this.mojo.project = new MavenProject(); this.mojo.project.setFile( new File( getClass().getResource( "pom.xml" ).getPath() ) ); this.mojo.pluginDescriptor = new PluginDescriptor(); this.mojo.pluginManager = mock( BuildPluginManager.class ); this.mojo.session = mock( MavenSession.class ); this.logStream = new ByteArrayOutputStream(); this.mojo.setLog( new DefaultLog( new PrintStreamLogger( Logger.LEVEL_INFO, "test", new PrintStream( this.logStream ) ) ) ); }
public static void execute(MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager) throws MojoExecutionException { executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.4") ), goal("list"), configuration( element(name("outputFile"), "${project.build.directory}/" + FILENAME) ), executionEnvironment( mavenProject, mavenSession, pluginManager ) ); }
public static void execute(MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager) throws MojoExecutionException { executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.4") ), goal("copy-dependencies"), configuration( element(name("outputDirectory"), "${project.build.directory}/dependency") ), executionEnvironment( mavenProject, mavenSession, pluginManager ) ); }
public static void execute(MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager, String webappRunnerversion) throws MojoExecutionException { executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.4") ), goal("copy"), configuration( element(name("artifactItems"), element(name("artifactItem"), element(name("groupId"), "com.github.jsimone"), element(name("artifactId"), "webapp-runner"), element(name("version"), webappRunnerversion), element(name("destFileName"), "webapp-runner.jar"))) ), executionEnvironment( mavenProject, mavenSession, pluginManager ) ); }
public static void initialize(MavenSession aMavenSession, BuildPluginManager aBuildPluginManager, Log aLog, DependencyTreeBuilder aDependencyTreeBuilder, ArtifactRepository aLocalRepository, SecDispatcher aSecurityDispatcher, MavenProjectBuilder aProjectBuilder, LifecycleExecutor aLifecycleExecutor, ArtifactFactory aArtifactFactory, ArtifactMetadataSource aArtifactMetadataSource, ArtifactCollector aArtifactCollector, RuntimeInformation aRuntimeInformation, MojoExecution aExecution) { ENVIRONMENT.set(new MavenEnvironment(aMavenSession, aBuildPluginManager, aLog, aDependencyTreeBuilder, aLocalRepository, aSecurityDispatcher, aProjectBuilder, aLifecycleExecutor, aArtifactFactory, aArtifactMetadataSource, aArtifactCollector, aRuntimeInformation, aExecution)); }
public NonDexSurefireExecution(Mode mode, int seed, Pattern filter, long start, long end, String nondexDir, String nondexJarDir, Plugin surefire, String originalArgLine, MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager) { this(surefire, originalArgLine, mavenProject, mavenSession, pluginManager, nondexDir); this.configuration = new Configuration(mode, seed, filter, start, end, nondexDir, nondexJarDir, null, this.executionId, Logger.getGlobal().getLoggingLevel()); }
public NonDexSurefireExecution(Configuration config, long start, long end, boolean print, String test, Plugin surefire, String originalArgLine, MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager) { this(surefire, originalArgLine, mavenProject, mavenSession, pluginManager, config.nondexDir); this.configuration = new Configuration(config.mode, config.seed, config.filter, start, end, config.nondexDir, config.nondexJarDir, test, this.executionId, Logger.getGlobal().getLoggingLevel(), print); }
protected CleanSurefireExecution(Plugin surefire, String originalArgLine, String executionId, MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager, String nondexDir) { this.executionId = executionId; this.surefire = surefire; this.originalArgLine = sanitizeAndRemoveEnvironmentVars(originalArgLine); this.mavenProject = mavenProject; this.mavenSession = mavenSession; this.pluginManager = pluginManager; this.configuration = new Configuration(executionId, nondexDir); }
public DebugTask(String test, Plugin surefire, String originalArgLine, MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager, List<Configuration> failingConfigurations) { this.test = test; this.surefire = surefire; this.originalArgLine = originalArgLine; this.mavenProject = mavenProject; this.mavenSession = mavenSession; this.pluginManager = pluginManager; this.failingConfigurations = failingConfigurations; }
public DefaultLifecycleExecutionPlanCalculator( BuildPluginManager pluginManager, DefaultLifecycles defaultLifeCycles, MojoDescriptorCreator mojoDescriptorCreator, LifecyclePluginResolver lifecyclePluginResolver, DefaultSchedules defaultSchedules ) { this.pluginManager = pluginManager; this.defaultLifeCycles = defaultLifeCycles; this.mojoDescriptorCreator = mojoDescriptorCreator; this.lifecyclePluginResolver = lifecyclePluginResolver; this.defaultSchedules = defaultSchedules; }
public MojoDescriptorCreator( PluginVersionResolver pluginVersionResolver, BuildPluginManager pluginManager, PluginPrefixResolver pluginPrefixResolver, LifecyclePluginResolver lifecyclePluginResolver ) { this.pluginVersionResolver = pluginVersionResolver; this.pluginManager = pluginManager; this.pluginPrefixResolver = pluginPrefixResolver; this.lifecyclePluginResolver = lifecyclePluginResolver; }
public BuildPluginManager getBuildPluginManager() { return buildPluginManager; }
@Test public void testInitialize() { assertNull(MavenEnvironment.get()); MavenSession aMavenSession = mock(MavenSession.class); BuildPluginManager aBuildPluginManager = mock(BuildPluginManager.class); Log aLog = mock(Log.class); DependencyTreeBuilder aDependencyTreeBuilder = mock(DependencyTreeBuilder.class); ArtifactRepository aLocalRepository = mock(ArtifactRepository.class); SecDispatcher aSecurityDispatcher = mock(SecDispatcher.class); MavenProjectBuilder aProjectBuilder = mock(MavenProjectBuilder.class); LifecycleExecutor aLifecycleExecutor = mock(LifecycleExecutor.class); ArtifactFactory aArtifactFactory = mock(ArtifactFactory.class); ArtifactMetadataSource aArtifactMetadataSource = mock(ArtifactMetadataSource.class); ArtifactCollector aArtifactCollector = mock(ArtifactCollector.class); RuntimeInformation aRuntimeInformation = mock(RuntimeInformation.class); MojoExecution theExecution = mock(MojoExecution.class); MavenEnvironment.initialize(aMavenSession, aBuildPluginManager, aLog, aDependencyTreeBuilder, aLocalRepository, aSecurityDispatcher, aProjectBuilder, aLifecycleExecutor, aArtifactFactory, aArtifactMetadataSource, aArtifactCollector, aRuntimeInformation, theExecution); MavenEnvironment theMavenEnvironment = MavenEnvironment.get(); assertNotNull(theMavenEnvironment); assertSame(aMavenSession, theMavenEnvironment.getMavenSession()); assertSame(aBuildPluginManager, theMavenEnvironment.getBuildPluginManager()); assertSame(aLog, theMavenEnvironment.getLog()); assertSame(aDependencyTreeBuilder, theMavenEnvironment.getDependencyTreeBuilder()); assertSame(aLocalRepository, theMavenEnvironment.getLocalRepository()); assertSame(aSecurityDispatcher, theMavenEnvironment.getSecurityDispatcher()); assertSame(aProjectBuilder, theMavenEnvironment.getProjectBuilder()); assertSame(aLifecycleExecutor, theMavenEnvironment.getLifecycleExecutor()); assertSame(aArtifactFactory, theMavenEnvironment.getArtifactFactory()); assertSame(aArtifactMetadataSource, theMavenEnvironment.getArtifactMetadataSource()); assertSame(aArtifactCollector, theMavenEnvironment.getArtifactCollector()); assertSame(aRuntimeInformation, theMavenEnvironment.getRuntimeInformation()); MavenEnvironment.cleanUp();; assertNull(MavenEnvironment.get()); }
private NonDexSurefireExecution(Plugin surefire, String originalArgLine, MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager, String nondexDir) { super(surefire, originalArgLine, Utils.getFreshExecutionId(), mavenProject, mavenSession, pluginManager, nondexDir); }
public CleanSurefireExecution(Plugin surefire, String originalArgLine, MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager, String nondexDir) { this(surefire, originalArgLine, "clean_" + Utils.getFreshExecutionId(), mavenProject, mavenSession, pluginManager, nondexDir); }
@Override protected BuildPluginManager getPluginManager() { return pluginManager; }
@Override protected BuildPluginManager getPluginManager() { // TODO Auto-generated method stub return pluginManager; }
public static void execute(MavenProject mavenProject, MavenSession mavenSession, BuildPluginManager pluginManager) throws MojoExecutionException { execute(mavenProject, mavenSession, pluginManager, DeployWar.DEFAULT_WEBAPP_RUNNER_VERSION); }
protected abstract BuildPluginManager getPluginManager();