This is an automated email from the ASF dual-hosted git repository. olamy pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-toolchains-plugin.git
The following commit(s) were added to refs/heads/master by this push: new 3f9736c Prefer Inject API over plexus-component-annotations (#127) 3f9736c is described below commit 3f9736c9f3cc90bb47519d8f99b60aee91f1b0fa Author: Olivier Lamy <ol...@apache.org> AuthorDate: Sat Jul 26 18:58:24 2025 +1000 Prefer Inject API over plexus-component-annotations (#127) * Prefer Inject API over plexus-component-annotations Signed-off-by: Olivier Lamy <ol...@apache.org> * dependency not needed Signed-off-by: Olivier Lamy <ol...@apache.org> --------- Signed-off-by: Olivier Lamy <ol...@apache.org> --- src/it/setup-custom-toolchain/pom.xml | 56 ++-------------------- .../its/custom/CustomToolchainFactory.java | 11 +++-- 2 files changed, 12 insertions(+), 55 deletions(-) diff --git a/src/it/setup-custom-toolchain/pom.xml b/src/it/setup-custom-toolchain/pom.xml index a82d309..476de67 100644 --- a/src/it/setup-custom-toolchain/pom.xml +++ b/src/it/setup-custom-toolchain/pom.xml @@ -40,12 +40,6 @@ under the License. <artifactId>maven-core</artifactId> <version>3.0.5</version> </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-component-annotations</artifactId> - <version>1.5.5</version> - <scope>provided</scope> - </dependency> <!-- plugin API and plugin-tools --> <dependency> @@ -77,18 +71,6 @@ under the License. <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> </plugin> - <plugin> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-component-metadata</artifactId> - <version>1.5.5</version> - <executions> - <execution> - <goals> - <goal>generate-metadata</goal> - </goals> - </execution> - </executions> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> @@ -110,40 +92,12 @@ under the License. </execution> </executions> </plugin> + <plugin> + <groupId>org.eclipse.sisu</groupId> + <artifactId>sisu-maven-plugin</artifactId> + <version>0.9.0.M3</version> + </plugin> </plugins> </build> - <profiles> - <profile> - <id>maven-2</id> - <!-- only necessary to build with Maven 2 --> - <activation> - <file> - <!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) --> - <missing>${basedir}</missing> - </file> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-plugin-plugin</artifactId> - <configuration> - <!-- see https://issues.apache.org/jira/browse/MNG-5346 --> - <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> - </configuration> - <executions> - <execution> - <id>mojo-descriptor</id> - <goals> - <!-- Maven 2 does not support phase overriding: need to add an execution --> - <goal>descriptor</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> </project> diff --git a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java index d7fbe66..5a74e31 100644 --- a/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java +++ b/src/it/setup-custom-toolchain/src/main/java/org/apache/maven/plugins/toolchains/its/custom/CustomToolchainFactory.java @@ -18,6 +18,10 @@ */ package org.apache.maven.plugins.toolchains.its.custom; +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; + import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.io.File; @@ -32,8 +36,6 @@ import org.apache.maven.toolchain.RequirementMatcherFactory; import org.apache.maven.toolchain.ToolchainFactory; import org.apache.maven.toolchain.ToolchainPrivate; import org.apache.maven.toolchain.model.ToolchainModel; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; @@ -44,10 +46,11 @@ import org.codehaus.plexus.util.xml.Xpp3Dom; * * @author Hervé Boutemy */ -@Component(role = ToolchainFactory.class, hint = "custom") +@Singleton +@Named("custom") public class CustomToolchainFactory implements ToolchainFactory { - @Requirement + @Inject private Logger logger; public ToolchainPrivate createToolchain(ToolchainModel model) throws MisconfiguredToolchainException {