Skip to content

Commit

Permalink
Adjust to changes in plexus API
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Dec 12, 2023
1 parent 1e1bdfa commit ef83550
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.codehaus.plexus.compiler.CompilerResult;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
Expand Down Expand Up @@ -83,6 +84,9 @@ public class JDTCompiler extends AbstractCompiler {
@Requirement
private JdkLibraryInfoProvider jdkLibInfoProvider;

@Requirement
private Logger logger;

public JDTCompiler() {
super(CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE, ".java", ".class", null);
}
Expand All @@ -107,7 +111,7 @@ public CompilerResult performCompile(CompilerConfiguration config) throws Compil
return new CompilerResult();
}

getLogger().info("Compiling " + sourceFiles.length + " " + "source file" + (sourceFiles.length == 1 ? "" : "s")
logger.info("Compiling " + sourceFiles.length + " " + "source file" + (sourceFiles.length == 1 ? "" : "s")
+ " to " + destinationDir.getAbsolutePath() + " using " + COMPILER_NAME + "");

Collection<Map.Entry<String, String>> customCompilerArgumentEntries = config
Expand Down Expand Up @@ -313,7 +317,7 @@ public String[] buildCompilerArguments(CompilerConfiguration config, CustomCompi
args.add("--release");
args.add(config.getReleaseVersion());
} else {
getLogger().debug("Custom java home and --release are incompatible, ignore --release="
logger.debug("Custom java home and --release are incompatible, ignore --release="
+ config.getReleaseVersion() + " setting ");
}
}
Expand Down Expand Up @@ -415,12 +419,12 @@ CompilerResult compileInProcess(String[] args, CompilerConfiguration config, Cus
addToCompilerArgumentsIfNotSet("--system", custom.javaHome, jdtCompilerArgs);
}
}
getLogger().debug("JDT compiler args: " + jdtCompilerArgs);
logger.debug("JDT compiler args: " + jdtCompilerArgs);
boolean success = compiler.compile(jdtCompilerArgs.toArray(new String[0]));

try {
String output = err.toString();
getLogger().debug("Original compiler output: " + output);
logger.debug("Original compiler output: " + output);
messages = parseModernStream(new BufferedReader(new StringReader(output)));
} catch (IOException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit ef83550

Please sign in to comment.