Skip to content

Commit

Permalink
Register ProjectFacadeAdapter using OSGI DS
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelistria committed Apr 4, 2022
1 parent 66f578e commit 0885fe9
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 11 deletions.
42 changes: 42 additions & 0 deletions m2e-maven-runtime/org.eclipse.m2e.maven.runtime/maven.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

The following files have been resolved:
org.apache.maven:maven-core:jar:3.8.5:compile -- module maven.core (auto)
org.apache.maven:maven-model:jar:3.8.5:compile -- module maven.model (auto)
org.apache.maven:maven-settings:jar:3.8.5:compile -- module maven.settings (auto)
org.apache.maven:maven-settings-builder:jar:3.8.5:compile -- module maven.settings.builder (auto)
org.apache.maven:maven-builder-support:jar:3.8.5:compile -- module maven.builder.support (auto)
org.apache.maven:maven-repository-metadata:jar:3.8.5:compile -- module maven.repository.metadata (auto)
org.apache.maven:maven-artifact:jar:3.8.5:compile -- module maven.artifact (auto)
org.apache.maven:maven-plugin-api:jar:3.8.5:compile -- module maven.plugin.api (auto)
org.apache.maven:maven-model-builder:jar:3.8.5:compile -- module maven.model.builder (auto)
org.apache.maven:maven-resolver-provider:jar:3.8.5:compile -- module maven.resolver.provider (auto)
org.apache.maven.resolver:maven-resolver-api:jar:1.6.3:compile -- module org.apache.maven.resolver [auto]
org.apache.maven.resolver:maven-resolver-spi:jar:1.6.3:compile -- module org.apache.maven.resolver.spi [auto]
org.apache.maven.resolver:maven-resolver-util:jar:1.6.3:compile -- module org.apache.maven.resolver.util [auto]
org.apache.maven.shared:maven-shared-utils:jar:3.3.4:compile -- module maven.shared.utils (auto)
commons-io:commons-io:jar:2.6:compile -- module org.apache.commons.io [auto]
org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.5:compile -- module org.eclipse.sisu.inject (auto)
com.google.inject:guice:jar:no_aop:4.2.2:compile -- module com.google.guice [auto]
org.codehaus.plexus:plexus-utils:jar:3.3.0:compile -- module plexus.utils (auto)
org.codehaus.plexus:plexus-classworlds:jar:2.6.0:compile -- module plexus.classworlds (auto)
org.codehaus.plexus:plexus-interpolation:jar:1.26:compile -- module plexus.interpolation (auto)
org.codehaus.plexus:plexus-component-annotations:jar:2.1.0:compile -- module plexus.component.annotations (auto)
org.apache.commons:commons-lang3:jar:3.8.1:compile -- module org.apache.commons.lang3 [auto]
org.apache.maven:maven-embedder:jar:3.8.5:compile -- module maven.embedder (auto)
javax.annotation:javax.annotation-api:jar:1.2:compile -- module javax.annotation.api (auto)
org.codehaus.plexus:plexus-sec-dispatcher:jar:2.0:compile -- module plexus.sec.dispatcher (auto)
org.codehaus.plexus:plexus-cipher:jar:2.0:compile -- module plexus.cipher (auto)
commons-cli:commons-cli:jar:1.4:compile -- module commons.cli (auto)
org.apache.maven:maven-compat:jar:3.8.5:compile -- module maven.compat (auto)
org.apache.maven.wagon:wagon-provider-api:jar:3.5.1:compile -- module wagon.provider.api (auto)
org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.5:compile -- module org.eclipse.sisu.plexus (auto)
org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile -- module plexus.build.api (auto)
io.takari.aether:aether-connector-okhttp:jar:0.17.8:compile -- module aether.connector.okhttp (auto)
com.squareup.okhttp3:okhttp:jar:3.14.1:compile -- module okhttp3 [auto]
com.squareup.okio:okio:jar:1.17.3:compile -- module okio [auto]
org.apache.maven.resolver:maven-resolver-impl:jar:1.6.3:compile -- module org.apache.maven.resolver.impl [auto]
org.apache.maven.resolver:maven-resolver-connector-basic:jar:1.6.3:compile -- module org.apache.maven.resolver.connector.basic [auto]
org.apache.maven.resolver:maven-resolver-transport-wagon:jar:1.6.3:compile -- module org.apache.maven.resolver.transport.wagon [auto]
org.apache.maven.wagon:wagon-file:jar:3.5.1:compile -- module wagon.file (auto)
org.fusesource.jansi:jansi:jar:2.4.0:compile -- module org.fusesource.jansi [auto]

5 changes: 5 additions & 0 deletions org.eclipse.m2e.core/.project
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
classpath=true
dsVersion=V1_3
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
2 changes: 2 additions & 0 deletions org.eclipse.m2e.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ Export-Package: org.eclipse.m2e.core,
MavenArtifact-GroupId: org.eclipse.m2e
MavenArtifact-ArtifactId: org.eclipse.m2e.core
Import-Package: javax.inject;version="1.0.0",
org.osgi.service.component.annotations;version="1.3.0",
org.slf4j;version="1.6.2"
Automatic-Module-Name: org.eclipse.m2e.core
Service-Component: OSGI-INF/org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory">
<property name="adaptableClass" value="org.eclipse.core.resources.IResource"/>
<service>
<provide interface="org.eclipse.core.runtime.IAdapterFactory"/>
</service>
<implementation class="org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory"/>
</scr:component>
3 changes: 2 additions & 1 deletion org.eclipse.m2e.core/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ bin.includes = plugin.xml,\
schema/,\
about.html,\
m2eclipse.gif,\
about_files/
about_files/,\
OSGI-INF/
jars.compile.order = .
output.. = bin/
source.. = src/,\
Expand Down
10 changes: 0 additions & 10 deletions org.eclipse.m2e.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,5 @@
class="org.eclipse.m2e.core.internal.project.WorkspaceTestsClassifierResolver">
</resolver>
</extension>
<extension
point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="org.eclipse.core.resources.IResource"
class="org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory">
<adapter
type="org.eclipse.m2e.core.project.IMavenProjectFacade">
</adapter>
</factory>
</extension>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
*******************************************************************************/
package org.eclipse.m2e.core.internal.project.registry;

import org.osgi.service.component.annotations.Component;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdapterFactory;

import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IMavenProjectFacade;


@Component(service = IAdapterFactory.class, property = {
IAdapterFactory.SERVICE_PROPERTY_ADAPTABLE_CLASS + "=org.eclipse.core.resources.IResource"})
public class ProjectFacadeAdapterFactory implements IAdapterFactory {

private static final Class<?>[] ADAPTER_LIST = {IMavenProjectFacade.class};
Expand Down

0 comments on commit 0885fe9

Please sign in to comment.