Skip to content

Commit aae8aa7

Browse files
committed
Add skip parameter and logging to module info compiler plugin
1 parent 00e93b1 commit aae8aa7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

java/maven/module-info-compiler-maven-plugin/src/main/java/org/apache/arrow/maven/plugins/ModuleInfoCompilerPlugin.java

+11
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,19 @@ public class ModuleInfoCompilerPlugin extends AbstractMojo {
5050
required = true)
5151
private final List<String> compileSourceRoots = new ArrayList<>();
5252

53+
@Parameter(defaultValue = "false", property = "skip", required = false)
54+
private boolean skip = false;
55+
5356
@Parameter(defaultValue = "${project}", readonly = true, required = true)
5457
private MavenProject project;
5558

5659
@Override
5760
public void execute() throws MojoExecutionException {
61+
if (skip) {
62+
getLog().info("Skipping module-info-compiler-maven-plugin");
63+
return;
64+
}
65+
5866
Optional<File> moduleInfoFile = findFirstModuleInfo(compileSourceRoots);
5967
if (moduleInfoFile.isPresent()) {
6068
// The compiled module-info.class file goes into target/classes/module-info/main
@@ -69,9 +77,12 @@ public void execute() throws MojoExecutionException {
6977
StandardCharsets.UTF_8);
7078
OutputStream output = Files.newOutputStream(targetPath)) {
7179
compiler.compile(reader, output);
80+
getLog().info("Successfully wrote module-info.class file.");
7281
} catch (IOException ex) {
7382
throw new MojoExecutionException("Error compiling module-info.java", ex);
7483
}
84+
} else {
85+
getLog().info("No module-info.java file found. module-info.class file was not generated.");
7586
}
7687
}
7788

0 commit comments

Comments
 (0)