Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Nov 21, 2024
1 parent 1870fbb commit 5307e98
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.maven.plugins.checkstyle;

import javax.inject.Inject;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
Expand Down Expand Up @@ -47,7 +49,6 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
Expand Down Expand Up @@ -294,12 +295,6 @@ public class CheckstyleViolationCheckMojo extends AbstractMojo {
@Parameter(property = "encoding", defaultValue = "${project.build.sourceEncoding}")
private String inputEncoding;

/**
* @since 2.5
*/
@Component(role = CheckstyleExecutor.class, hint = "default")
protected CheckstyleExecutor checkstyleExecutor;

/**
* Output errors to console.
*/
Expand Down Expand Up @@ -487,6 +482,16 @@ public class CheckstyleViolationCheckMojo extends AbstractMojo {

private File outputXmlFile;

/**
* @since 2.5
*/
private CheckstyleExecutor checkstyleExecutor;

@Inject
public CheckstyleViolationCheckMojo(CheckstyleExecutor checkstyleExecutor) {
this.checkstyleExecutor = checkstyleExecutor;
}

/** {@inheritDoc} */
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
Expand Down

0 comments on commit 5307e98

Please sign in to comment.