Skip to content

Commit 6b7be3f

Browse files
authored
Convert to JSR 330 component (#37)
Get rid of legacy dependencies and components for Plexus Containers This closes #36
1 parent 64c9137 commit 6b7be3f

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

pom.xml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,20 @@ See the Apache License Version 2.0 for the specific language governing permissio
2424
<version>0.0.8-SNAPSHOT</version>
2525

2626
<dependencies>
27-
<dependency>
28-
<groupId>org.codehaus.plexus</groupId>
29-
<artifactId>plexus-component-annotations</artifactId>
30-
<scope>provided</scope>
31-
</dependency>
3227
<dependency>
3328
<groupId>org.codehaus.plexus</groupId>
3429
<artifactId>plexus-utils</artifactId>
3530
<version>3.4.2</version>
3631
</dependency>
3732
<dependency>
38-
<groupId>org.codehaus.plexus</groupId>
39-
<artifactId>plexus-container-default</artifactId>
40-
<version>2.1.1</version>
41-
<scope>provided</scope>
33+
<groupId>javax.inject</groupId>
34+
<artifactId>javax.inject</artifactId>
35+
<version>1</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.slf4j</groupId>
39+
<artifactId>slf4j-api</artifactId>
40+
<version>1.7.36</version>
4241
</dependency>
4342
</dependencies>
4443

@@ -51,16 +50,18 @@ See the Apache License Version 2.0 for the specific language governing permissio
5150
</resources>
5251
<plugins>
5352
<plugin>
54-
<groupId>org.codehaus.plexus</groupId>
55-
<artifactId>plexus-maven-plugin</artifactId>
56-
<version>1.3.8</version>
53+
<groupId>org.eclipse.sisu</groupId>
54+
<artifactId>sisu-maven-plugin</artifactId>
55+
<version>0.3.5</version>
5756
<executions>
58-
<execution>
59-
<goals>
60-
<goal>descriptor</goal>
61-
</goals>
62-
</execution>
63-
</executions>
57+
<execution>
58+
<id>index-project</id>
59+
<goals>
60+
<goal>main-index</goal>
61+
<goal>test-index</goal>
62+
</goals>
63+
</execution>
64+
</executions>
6465
</plugin>
6566
<plugin>
6667
<groupId>org.apache.maven.plugins</groupId>

src/main/java/org/sonatype/plexus/build/incremental/DefaultBuildContext.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@
1313

1414
package org.sonatype.plexus.build.incremental;
1515

16+
import javax.inject.Named;
17+
import javax.inject.Singleton;
18+
1619
import java.io.File;
1720
import java.io.FileOutputStream;
1821
import java.io.IOException;
1922
import java.io.OutputStream;
2023
import java.util.List;
2124

22-
import org.codehaus.plexus.component.annotations.Component;
23-
import org.codehaus.plexus.logging.AbstractLogEnabled;
2425
import org.codehaus.plexus.util.DirectoryScanner;
2526
import org.codehaus.plexus.util.Scanner;
27+
import org.slf4j.Logger;
28+
import org.slf4j.LoggerFactory;
2629

2730
/**
2831
* Filesystem based non-incremental build context implementation which behaves as if all files
@@ -34,9 +37,11 @@
3437
* isIncremental returns false
3538
* getValue always returns null
3639
*/
37-
@Component( role = BuildContext.class, hint = "default")
38-
public class DefaultBuildContext extends AbstractLogEnabled implements BuildContext {
40+
@Named("default")
41+
@Singleton
42+
public class DefaultBuildContext implements BuildContext {
3943

44+
private final Logger logger = LoggerFactory.getLogger(DefaultBuildContext.class);
4045
/** {@inheritDoc} */
4146
public boolean hasDelta(String relpath) {
4247
return true;
@@ -125,10 +130,10 @@ public void addWarning(File file, int line, int column, String message, Throwabl
125130
public void addMessage(File file, int line, int column, String message, int severity, Throwable cause) {
126131
switch(severity) {
127132
case BuildContext.SEVERITY_ERROR:
128-
getLogger().error(getMessage(file, line, column, message), cause);
133+
logger.error(getMessage(file, line, column, message), cause);
129134
return;
130135
case BuildContext.SEVERITY_WARNING:
131-
getLogger().warn(getMessage(file, line, column, message), cause);
136+
logger.warn(getMessage(file, line, column, message), cause);
132137
return;
133138
}
134139
throw new IllegalArgumentException("severity=" + severity);

0 commit comments

Comments
 (0)