|
18 | 18 | */
|
19 | 19 | package org.apache.maven.plugins.checkstyle.exec;
|
20 | 20 |
|
| 21 | +import javax.inject.Inject; |
| 22 | +import javax.inject.Named; |
| 23 | + |
21 | 24 | import java.io.ByteArrayInputStream;
|
22 | 25 | import java.io.File;
|
23 | 26 | import java.io.FileInputStream;
|
|
49 | 52 | import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
50 | 53 | import org.apache.maven.model.Resource;
|
51 | 54 | import org.apache.maven.project.MavenProject;
|
52 |
| -import org.codehaus.plexus.component.annotations.Component; |
53 |
| -import org.codehaus.plexus.component.annotations.Requirement; |
54 | 55 | import org.codehaus.plexus.logging.AbstractLogEnabled;
|
55 | 56 | import org.codehaus.plexus.resource.ResourceManager;
|
56 | 57 | import org.codehaus.plexus.resource.loader.FileResourceCreationException;
|
|
63 | 64 | * @since 2.5
|
64 | 65 | *
|
65 | 66 | */
|
66 |
| -@Component(role = CheckstyleExecutor.class, hint = "default", instantiationStrategy = "per-lookup") |
| 67 | +@Named |
67 | 68 | public class DefaultCheckstyleExecutor extends AbstractLogEnabled implements CheckstyleExecutor {
|
68 |
| - @Requirement(hint = "default") |
69 | 69 | private ResourceManager locator;
|
70 | 70 |
|
71 |
| - @Requirement(hint = "license") |
72 | 71 | private ResourceManager licenseLocator;
|
73 | 72 |
|
| 73 | + @Inject |
| 74 | + public DefaultCheckstyleExecutor( |
| 75 | + @Named("default") ResourceManager locator, @Named("license") ResourceManager licenseLocator) { |
| 76 | + this.locator = locator; |
| 77 | + this.licenseLocator = licenseLocator; |
| 78 | + } |
| 79 | + |
| 80 | + @Override |
74 | 81 | public CheckstyleResults executeCheckstyle(CheckstyleExecutorRequest request)
|
75 | 82 | throws CheckstyleExecutorException, CheckstyleException {
|
76 | 83 | if (getLogger().isDebugEnabled()) {
|
@@ -255,6 +262,7 @@ protected void addSourceDirectory(
|
255 | 262 | }
|
256 | 263 | }
|
257 | 264 |
|
| 265 | + @Override |
258 | 266 | public Configuration getConfiguration(CheckstyleExecutorRequest request) throws CheckstyleExecutorException {
|
259 | 267 | try {
|
260 | 268 | // Checkstyle will always use the context classloader in order
|
|
0 commit comments