Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maven plugin - use Log.info() #384

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
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 @@ -82,13 +83,12 @@ private FileWriter createFileWriter(String string) throws IOException {
return new FileWriter(new File(project.getBuild().getDirectory(), string));
}

private void writeProvidedPlugins(URLClassLoader newClassLoader, FileWriter pluginWriter)
throws IOException {
private void writeProvidedPlugins(URLClassLoader newClassLoader, FileWriter pluginWriter) throws IOException {
final Set<String> providedTypes = new HashSet<>();

final Log log = getLog();
for (final var plugin : ServiceLoader.load(Plugin.class, newClassLoader)) {

System.out.println("Loaded Plugin: " + plugin.getClass().getCanonicalName());
log.info("Loaded Plugin: " + plugin.getClass().getCanonicalName());

for (final Class<?> provide : plugin.provides()) {
providedTypes.add(provide.getCanonicalName());
Expand All @@ -104,13 +104,12 @@ private void writeProvidedPlugins(URLClassLoader newClassLoader, FileWriter plug
}
}

private void writeProvidedModules(URLClassLoader newClassLoader, FileWriter moduleWriter)
throws IOException {
private void writeProvidedModules(URLClassLoader newClassLoader, FileWriter moduleWriter) throws IOException {
final Set<String> providedTypes = new HashSet<>();

final Log log = getLog();
for (final var module : ServiceLoader.load(Module.class, newClassLoader)) {

System.out.println("Detected External Module: " + module.getClass().getCanonicalName());
log.info("Detected External Module: " + module.getClass().getCanonicalName());

for (final Class<?> provide : module.provides()) {
providedTypes.add(provide.getCanonicalName());
Expand Down