Skip to content

Commit

Permalink
#14 Support injection of LocationManager via @Inject and ServiceLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
rfscholte committed Aug 27, 2018
1 parent 8e20d80 commit 800b724
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 31 deletions.
28 changes: 11 additions & 17 deletions plexus-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>1.7.1</version>
<!-- WATCH OUT duplicate compiler blocks confuses this plugin -->
<!-- Generated components.xml copied to src/main/resources -->
<configuration>
<extractors>
<extractor>source</extractor>
</extractors>
</configuration>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>0.3.3</version>
<executions>
<execution>
<id>index-project</id>
<goals>
<goal>main-index</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Rerun unittests with the multirelease jar, cannot be done with exploded directory of classes -->
<plugin>
Expand Down Expand Up @@ -73,19 +74,12 @@
<artifactId>qdox</artifactId>
<version>2.0-M9</version>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>1.7.1</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import java.util.Map.Entry;
import java.util.Set;

import javax.inject.Named;
import javax.inject.Singleton;

import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor.JavaProvides;

/**
Expand All @@ -41,8 +41,8 @@
* @author Robert Scholte
* @since 1.0.0
*/
@Named
@Singleton
@Component( role = LocationManager.class )
public class LocationManager
{
private ModuleInfoParser binaryParser;
Expand Down
2 changes: 2 additions & 0 deletions plexus-java/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@

exports org.codehaus.plexus.languages.java.jpms;
exports org.codehaus.plexus.languages.java.version;

provides org.codehaus.plexus.languages.java.jpms.LocationManager with org.codehaus.plexus.languages.java.jpms.LocationManager;
}
12 changes: 0 additions & 12 deletions plexus-java/src/main/resources/META-INF/plexus/components.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.codehaus.plexus.languages.java.jpms.LocationManager

0 comments on commit 800b724

Please sign in to comment.