From 8b2aa95066e7d6390d8ef078d4ee91423c31303a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 6 Jan 2024 13:59:46 +0100 Subject: [PATCH] Move components to JSR330 --- pom.xml | 14 ++++++++++++++ tycho-core/pom.xml | 4 ++++ .../osgitools/BuildPropertiesParserImpl.java | 19 ++++++++----------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 37f16ad70f..fd8705519b 100644 --- a/pom.xml +++ b/pom.xml @@ -488,6 +488,20 @@ maven-invoker-plugin 3.6.0 + + org.eclipse.sisu + sisu-maven-plugin + 0.9.0.M2 + + + index-project + + main-index + test-index + + + + diff --git a/tycho-core/pom.xml b/tycho-core/pom.xml index 62e55b5915..079c5d5119 100644 --- a/tycho-core/pom.xml +++ b/tycho-core/pom.xml @@ -157,6 +157,10 @@ + + org.eclipse.sisu + sisu-maven-plugin + diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java index d28cdc5be0..61cbd5b598 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java @@ -25,12 +25,13 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; + import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.LegacySupport; import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; import org.eclipse.tycho.BuildProperties; import org.eclipse.tycho.BuildPropertiesParser; import org.eclipse.tycho.Interpolator; @@ -38,12 +39,13 @@ import org.eclipse.tycho.core.BuildPropertiesImpl; import org.eclipse.tycho.core.maven.TychoInterpolator; -@Component(role = BuildPropertiesParser.class) -public class BuildPropertiesParserImpl implements BuildPropertiesParser, Disposable { +@Named +@Singleton +public class BuildPropertiesParserImpl implements BuildPropertiesParser { private final Map cache = new HashMap<>(); - @Requirement + @Inject LegacySupport legacySupport; @Override @@ -92,11 +94,6 @@ private synchronized BuildProperties get(File baseDir, Supplier in return buildProperties; } - @Override - public void dispose() { - cache.clear(); - } - protected static Properties readProperties(File propsFile, MavenProject mavenProject) { Properties properties = new Properties(); if (propsFile.isFile()) {