From 77b81077408c550563483b8b9911fd51ee5ac4d6 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 bc5c2215c1..56b0bd7e90 100644 --- a/pom.xml +++ b/pom.xml @@ -506,6 +506,20 @@ maven-invoker-plugin 3.6.1 + + 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 40bec9436d..5f4409e1b8 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()) {