org.eclipse.tycho
tycho-core
@@ -42,8 +58,8 @@
- org.codehaus.plexus
- plexus-component-metadata
+ org.eclipse.sisu
+ sisu-maven-plugin
org.apache.maven.plugins
diff --git a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServiceConfigurationReader.java b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServiceConfigurationReader.java
index 824fc9ab52..f96e1241a3 100644
--- a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServiceConfigurationReader.java
+++ b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServiceConfigurationReader.java
@@ -21,15 +21,18 @@
import org.apache.maven.model.Plugin;
import org.apache.maven.project.MavenProject;
-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.xml.Xpp3Dom;
import org.eclipse.tycho.ReactorProject;
import org.eclipse.tycho.core.DeclarativeServicesConfiguration;
import org.osgi.framework.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-@Component(role = DeclarativeServiceConfigurationReader.class)
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+@Singleton
+@Named
public class DeclarativeServiceConfigurationReader {
private static final String DS_PLUGIN = "org.eclipse.tycho:tycho-ds-plugin";
@@ -44,8 +47,7 @@ public class DeclarativeServiceConfigurationReader {
private static final String PDE_DS_ANNOTATIONS_PREFS = ".settings/org.eclipse.pde.ds.annotations.prefs";
- @Requirement
- private Logger logger;
+ private final Logger logger = LoggerFactory.getLogger(getClass());
public DeclarativeServicesConfiguration getConfiguration(ReactorProject reactorProject) throws IOException {
return getConfiguration(Objects.requireNonNull(reactorProject.adapt(MavenProject.class)));
diff --git a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesClasspathContributor.java b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesClasspathContributor.java
index 68b709de2c..30e954ea06 100644
--- a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesClasspathContributor.java
+++ b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesClasspathContributor.java
@@ -18,13 +18,12 @@
import java.util.Optional;
import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
-import org.apache.maven.SessionScoped;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.tycho.ArtifactKey;
import org.eclipse.tycho.ResolvedArtifactKey;
@@ -34,6 +33,7 @@
import org.eclipse.tycho.core.TychoProjectManager;
import org.eclipse.tycho.core.maven.MavenDependenciesResolver;
import org.eclipse.tycho.core.osgitools.AbstractSpecificationClasspathContributor;
+import org.eclipse.tycho.core.osgitools.MavenBundleResolver;
import org.osgi.framework.Version;
import org.osgi.framework.VersionRange;
@@ -43,8 +43,8 @@
import aQute.bnd.osgi.Constants;
import aQute.bnd.osgi.Processor;
-@Component(role = ClasspathContributor.class, hint = "ds-annotations")
-@SessionScoped
+@Singleton
+@Named("ds-annotations")
public class DeclarativeServicesClasspathContributor extends AbstractSpecificationClasspathContributor
implements ClasspathContributor {
@@ -56,18 +56,18 @@ public class DeclarativeServicesClasspathContributor extends AbstractSpecificati
private static final String DS_ANNOTATIONS_1_2_ARTIFACT_ID = "osgi.cmpn";
private static final String DS_ANNOTATIONS_1_2_VERSION = "5.0.0";
- @Requirement
+ @Inject
DeclarativeServiceConfigurationReader configurationReader;
- @Requirement
+ @Inject
MavenDependenciesResolver dependenciesResolver;
- @Requirement
+ @Inject
TychoProjectManager projectManager;
@Inject
- public DeclarativeServicesClasspathContributor(MavenSession session) {
- super(session, DS_ANNOTATIONS_PACKAGE, DS_ANNOTATIONS_GROUP_ID, DS_ANNOTATIONS_ARTIFACT_ID);
+ public DeclarativeServicesClasspathContributor(MavenBundleResolver mavenBundleResolver, MavenSession session) {
+ super(mavenBundleResolver, session, DS_ANNOTATIONS_PACKAGE, DS_ANNOTATIONS_GROUP_ID, DS_ANNOTATIONS_ARTIFACT_ID);
}
@Override
diff --git a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesMojo.java b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesMojo.java
index e7e502cf8a..0fa1ac9cae 100644
--- a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesMojo.java
+++ b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/DeclarativeServicesMojo.java
@@ -23,8 +23,6 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@@ -46,6 +44,10 @@
import aQute.bnd.osgi.Constants;
import aQute.bnd.osgi.Jar;
import aQute.bnd.osgi.Resource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
/**
* This mojo generates 0) {
- log.info(generated + " component(s) where generated, " + keep + " where kept.");
+ logger.info(generated + " component(s) where generated, " + keep + " where kept.");
} else {
- log.info(generated + " component(s) where generated.");
+ logger.info(generated + " component(s) where generated.");
}
}
} catch (Exception e) {
diff --git a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/ServiceComponentManifestProcessor.java b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/ServiceComponentManifestProcessor.java
index 9000018efb..d51aa1a935 100644
--- a/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/ServiceComponentManifestProcessor.java
+++ b/tycho-ds-plugin/src/main/java/org/eclipse/tycho/ds/ServiceComponentManifestProcessor.java
@@ -15,12 +15,15 @@
import java.util.jar.Manifest;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
import org.eclipse.tycho.ReactorProject;
import org.eclipse.tycho.core.osgitools.DefaultReactorProject;
import org.eclipse.tycho.packaging.ManifestProcessor;
-@Component(role = ManifestProcessor.class, hint = "scr")
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+@Singleton
+@Named("scr")
public class ServiceComponentManifestProcessor implements ManifestProcessor {
@Override
diff --git a/tycho-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/tycho-maven-plugin/src/main/resources/META-INF/plexus/components.xml
index c8b238f511..fb20272c23 100644
--- a/tycho-maven-plugin/src/main/resources/META-INF/plexus/components.xml
+++ b/tycho-maven-plugin/src/main/resources/META-INF/plexus/components.xml
@@ -1,6 +1,8 @@
+
+
org.apache.maven.lifecycle.mapping.LifecycleMapping
eclipse-plugin
diff --git a/tycho-p2-publisher-plugin/pom.xml b/tycho-p2-publisher-plugin/pom.xml
index 803ada996b..671f662b50 100644
--- a/tycho-p2-publisher-plugin/pom.xml
+++ b/tycho-p2-publisher-plugin/pom.xml
@@ -26,6 +26,18 @@
Tycho p2 Publisher Plugin
+
+ javax.inject
+ javax.inject
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.slf4j
+ slf4j-simple
+
org.apache.maven
maven-plugin-api
@@ -67,8 +79,8 @@
- org.codehaus.plexus
- plexus-component-metadata
+ org.eclipse.sisu
+ sisu-maven-plugin
diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java
index ac52c6e69f..390616870d 100644
--- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java
+++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/AbstractPublishMojo.java
@@ -16,19 +16,20 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.eclipse.tycho.DependencySeed;
import org.eclipse.tycho.core.maven.AbstractP2Mojo;
import org.eclipse.tycho.p2.tools.publisher.facade.PublisherServiceFactory;
import org.eclipse.tycho.p2tools.RepositoryReferenceTool;
+import javax.inject.Inject;
+
public abstract class AbstractPublishMojo extends AbstractP2Mojo {
private static final Object LOCK = new Object();
- @Component
+ @Inject
private RepositoryReferenceTool repositoryReferenceTool;
- @Component()
+ @Inject
PublisherServiceFactory publisherServiceFactory;
@Override
diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java
index 8af373d006..22a0a69110 100644
--- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java
+++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java
@@ -21,7 +21,6 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@@ -29,14 +28,14 @@
import org.codehaus.plexus.util.FileUtils;
import org.eclipse.tycho.BuildDirectory;
import org.eclipse.tycho.DependencySeed;
-import org.eclipse.tycho.PackagingType;
-import org.eclipse.tycho.core.TychoProject;
import org.eclipse.tycho.core.osgitools.EclipseRepositoryProject;
import org.eclipse.tycho.model.Category;
import org.eclipse.tycho.p2.tools.FacadeException;
import org.eclipse.tycho.p2.tools.publisher.facade.PublisherService;
import org.eclipse.tycho.p2.tools.publisher.facade.PublisherServiceFactory;
+import javax.inject.Inject;
+
/**
*
* Publishes the category definitions from the category.xml
in the root of the project.
@@ -47,7 +46,7 @@
@Mojo(name = "publish-categories", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME)
public final class PublishCategoriesMojo extends AbstractPublishMojo {
- @Component(role = TychoProject.class, hint = PackagingType.TYPE_ECLIPSE_REPOSITORY)
+ @Inject
private EclipseRepositoryProject eclipseRepositoryProject;
/**
diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java
index 63a79e713b..e724889a7c 100644
--- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java
+++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishOsgiEEMojo.java
@@ -19,19 +19,21 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.toolchain.ToolchainManager;
-import org.codehaus.plexus.logging.Logger;
import org.eclipse.tycho.DependencySeed;
import org.eclipse.tycho.ExecutionEnvironment;
import org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils;
import org.eclipse.tycho.p2.tools.FacadeException;
import org.eclipse.tycho.p2.tools.publisher.facade.PublisherService;
import org.eclipse.tycho.p2.tools.publisher.facade.PublisherServiceFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
/**
*
@@ -44,6 +46,8 @@
@Mojo(name = "publish-osgi-ee", defaultPhase = LifecyclePhase.PREPARE_PACKAGE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME)
public final class PublishOsgiEEMojo extends AbstractPublishMojo {
+ private final Logger logger = LoggerFactory.getLogger(getClass());
+
/**
*
* Comma-separated list of profile names to be published. Examples: JavaSE-11, JavaSE-17,
@@ -58,12 +62,9 @@ public final class PublishOsgiEEMojo extends AbstractPublishMojo {
@Parameter(defaultValue = "false")
private boolean skip;
- @Component
+ @Inject
private ToolchainManager toolchainManager;
- @Component
- private Logger logger;
-
@Override
protected Collection publishContent(PublisherServiceFactory publisherServiceFactory)
throws MojoExecutionException, MojoFailureException {
diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductInstallableUnitProvider.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductInstallableUnitProvider.java
index b3ecfa3488..59dbc79ade 100644
--- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductInstallableUnitProvider.java
+++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductInstallableUnitProvider.java
@@ -22,8 +22,6 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Plugin;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
@@ -33,12 +31,17 @@
import org.eclipse.tycho.p2maven.actions.ProductFile2;
import org.eclipse.tycho.resolver.InstallableUnitProvider;
-@Component(role = InstallableUnitProvider.class, hint = PublishProductInstallableUnitProvider.HINT)
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+@Singleton
+@Named(PublishProductInstallableUnitProvider.HINT)
public class PublishProductInstallableUnitProvider implements InstallableUnitProvider {
static final String HINT = "publish-products";
- @Requirement
+ @Inject
private InstallableUnitGenerator installableUnitGenerator;
@Override
diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMetadataProvider.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMetadataProvider.java
index 46396a34c3..bdcc71391c 100644
--- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMetadataProvider.java
+++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMetadataProvider.java
@@ -6,8 +6,6 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.tycho.IDependencyMetadata;
import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType;
@@ -17,10 +15,15 @@
import org.eclipse.tycho.p2maven.InstallableUnitGenerator;
import org.eclipse.tycho.resolver.P2MetadataProvider;
-@Component(role = P2MetadataProvider.class, hint = PublishProductInstallableUnitProvider.HINT)
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+@Singleton
+@Named(PublishProductInstallableUnitProvider.HINT)
public class PublishProductMetadataProvider implements P2MetadataProvider {
- @Requirement
+ @Inject
private InstallableUnitGenerator installableUnitGenerator;
@Override
diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java
index fe7cfbef77..7dfbf592fa 100644
--- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java
+++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java
@@ -30,7 +30,6 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@@ -65,6 +64,9 @@
import org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManager;
import org.osgi.framework.Version;
+import javax.inject.Inject;
+import javax.inject.Provider;
+
/**
*
* Publishes all product definitions files (*.product
) that are present in the root of
@@ -84,16 +86,16 @@ public final class PublishProductMojo extends AbstractPublishMojo {
*/
private static final String FLAVOR = "tooling";
- @Component(role = UnArchiver.class, hint = "zip")
- private UnArchiver deflater;
+ @Inject
+ private Provider deflaterProvider;
- @Component
+ @Inject
private FileLockService fileLockService;
- @Component(role = TychoProject.class, hint = PackagingType.TYPE_ECLIPSE_REPOSITORY)
+ @Inject
private EclipseRepositoryProject eclipseRepositoryProject;
- @Component
+ @Inject
private ReactorRepositoryManager reactorRepoManager;
/**
@@ -224,6 +226,7 @@ private File getExpandedLauncherBinaries() throws MojoExecutionException, MojoFa
try (var locked = fileLockService.lock(equinoxExecFeature)) {
// unzip now then:
unzipped.mkdirs();
+ UnArchiver deflater = deflaterProvider.get();
deflater.setSourceFile(equinoxExecFeature);
deflater.setDestDirectory(unzipped);
deflater.extract();
diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java
index 26aa02e561..e6da8c253f 100644
--- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java
+++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/persistence/AttachPublishedArtifactsMojo.java
@@ -19,15 +19,17 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.project.MavenProjectHelper;
-import org.codehaus.plexus.logging.Logger;
import org.eclipse.tycho.IDependencyMetadata.DependencyMetadataType;
import org.eclipse.tycho.PublishingRepositoryFacade;
import org.eclipse.tycho.ReactorProject;
import org.eclipse.tycho.core.maven.AbstractP2Mojo;
import org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
/**
*
@@ -40,15 +42,14 @@
public class AttachPublishedArtifactsMojo extends AbstractP2Mojo {
private static final Object LOCK = new Object();
- @Component
+ private final Logger logger = LoggerFactory.getLogger(getClass());
+
+ @Inject
private MavenProjectHelper projectHelper;
- @Component()
+ @Inject
ReactorRepositoryManager reactorRepoManager;
- @Component
- private Logger logger;
-
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
synchronized (LOCK) {