Skip to content

Commit 800b724

Browse files
committed
#14 Support injection of LocationManager via @Inject and ServiceLoader
1 parent 8e20d80 commit 800b724

File tree

5 files changed

+16
-31
lines changed

5 files changed

+16
-31
lines changed

plexus-java/pom.xml

+11-17
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@
2828
</pluginManagement>
2929
<plugins>
3030
<plugin>
31-
<groupId>org.codehaus.plexus</groupId>
32-
<artifactId>plexus-component-metadata</artifactId>
33-
<version>1.7.1</version>
34-
<!-- WATCH OUT duplicate compiler blocks confuses this plugin -->
35-
<!-- Generated components.xml copied to src/main/resources -->
36-
<configuration>
37-
<extractors>
38-
<extractor>source</extractor>
39-
</extractors>
40-
</configuration>
31+
<groupId>org.eclipse.sisu</groupId>
32+
<artifactId>sisu-maven-plugin</artifactId>
33+
<version>0.3.3</version>
34+
<executions>
35+
<execution>
36+
<id>index-project</id>
37+
<goals>
38+
<goal>main-index</goal>
39+
</goals>
40+
</execution>
41+
</executions>
4142
</plugin>
4243
<!-- Rerun unittests with the multirelease jar, cannot be done with exploded directory of classes -->
4344
<plugin>
@@ -73,19 +74,12 @@
7374
<artifactId>qdox</artifactId>
7475
<version>2.0-M9</version>
7576
</dependency>
76-
7777
<dependency>
7878
<groupId>javax.inject</groupId>
7979
<artifactId>javax.inject</artifactId>
8080
<version>1</version>
8181
<optional>true</optional>
8282
</dependency>
83-
<dependency>
84-
<groupId>org.codehaus.plexus</groupId>
85-
<artifactId>plexus-component-annotations</artifactId>
86-
<version>1.7.1</version>
87-
<optional>true</optional>
88-
</dependency>
8983

9084
<dependency>
9185
<groupId>junit</groupId>

plexus-java/src/main/java/org/codehaus/plexus/languages/java/jpms/LocationManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
import java.util.Map.Entry;
3131
import java.util.Set;
3232

33+
import javax.inject.Named;
3334
import javax.inject.Singleton;
3435

35-
import org.codehaus.plexus.component.annotations.Component;
3636
import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor.JavaProvides;
3737

3838
/**
@@ -41,8 +41,8 @@
4141
* @author Robert Scholte
4242
* @since 1.0.0
4343
*/
44+
@Named
4445
@Singleton
45-
@Component( role = LocationManager.class )
4646
public class LocationManager
4747
{
4848
private ModuleInfoParser binaryParser;

plexus-java/src/main/java9/module-info.java

+2
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323

2424
exports org.codehaus.plexus.languages.java.jpms;
2525
exports org.codehaus.plexus.languages.java.version;
26+
27+
provides org.codehaus.plexus.languages.java.jpms.LocationManager with org.codehaus.plexus.languages.java.jpms.LocationManager;
2628
}

plexus-java/src/main/resources/META-INF/plexus/components.xml

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.codehaus.plexus.languages.java.jpms.LocationManager

0 commit comments

Comments
 (0)