From c5197225f2ddf2296016bfbbd2aaa983b5a7f8e4 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Thu, 21 Nov 2024 17:57:42 -0500 Subject: [PATCH] more --- .../archetype/mojos/IntegrationTestMojo.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java index e96975c8..3514217e 100644 --- a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java +++ b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java @@ -18,6 +18,8 @@ */ package org.apache.maven.archetype.mojos; +import javax.inject.Inject; + import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @@ -50,7 +52,6 @@ import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; @@ -131,18 +132,26 @@ @Mojo(name = "integration-test", requiresProject = true) public class IntegrationTestMojo extends AbstractMojo { - @Component private ArchetypeGenerator archetypeGenerator; - @Component private Downloader downloader; - @Component private Invoker invoker; - @Component private ArchetypeGenerationConfigurator archetypeGenerationConfigurator; + @Inject + public IntegrationTestMojo( + ArchetypeGenerator archetypeGenerator, + Downloader downloader, + Invoker invoker, + ArchetypeGenerationConfigurator archetypeGenerationConfigurator) { + this.archetypeGenerationConfigurator = archetypeGenerationConfigurator; + this.downloader = downloader; + this.invoker = invoker; + this.archetypeGenerationConfigurator = archetypeGenerationConfigurator; + } + /** * The archetype project to execute the integration tests on. */