Skip to content

Commit 9f8dbd0

Browse files
olamyfniephaus
authored andcommitted
Add a parameter to be able to skip build native for pom type modules, leave it as false per default for backward compat
Signed-off-by: Olivier Lamy <[email protected]>
1 parent d4b5ce3 commit 9f8dbd0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeCompileNoForkMojo.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public class NativeCompileNoForkMojo extends AbstractNativeImageMojo {
7171
@Parameter(property = "skipNativeBuild", defaultValue = "false")
7272
private boolean skip;
7373

74+
@Parameter(property = "skipNativeBuildForPom", defaultValue = "false")
75+
private boolean skipNativeBuildForPom;
76+
7477
private PluginParameterExpressionEvaluator evaluator;
7578

7679
@Override
@@ -88,6 +91,11 @@ public void execute() throws MojoExecutionException {
8891
return;
8992
}
9093

94+
if(skipNativeBuildForPom && project.getPackaging().equals("pom")) {
95+
logger.info("Skipping native-image generation (parameter 'skipNativeBuildForPom' is true).");
96+
return;
97+
}
98+
9199
evaluator = new PluginParameterExpressionEvaluator(session, mojoExecution);
92100
maybeSetMainClassFromPlugin(this::consumeExecutionsNodeValue, "org.apache.maven.plugins:maven-shade-plugin", "transformers", "transformer", "mainClass");
93101
maybeSetMainClassFromPlugin(this::consumeConfigurationNodeValue, "org.apache.maven.plugins:maven-assembly-plugin", "archive", "manifest", "mainClass");

0 commit comments

Comments
 (0)