diff --git a/README.md b/README.md index 528d8bb..2457bcb 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,35 @@ Additional arguments to can go in the `` configuration section. ``` +## Skipping an execution + +If you need to skip an execution, you can set `true` in the +`` block of the `` of the plugin. + +```xml +true +``` + +This is probably most useful when driven from a property. + +```xml +${skipRustBuild} +``` + +The property can be defaulted in the `` section of the `pom.xml` file. + +```xml + + false + +``` + +And then overridden on the command line with `-DskipRustBuild=true`. + +```shell +$ mvn package -DskipRustBuild=true +``` + ## Overriding Environment Variables The plugin can be configured to override environment variables during the build. diff --git a/jar-jni/pom.xml b/jar-jni/pom.xml index f5b87a8..6d715f8 100644 --- a/jar-jni/pom.xml +++ b/jar-jni/pom.xml @@ -26,7 +26,7 @@ 4.0.0 org.questdb jar-jni - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT jar JAR JNI Loader diff --git a/pom.xml b/pom.xml index e465df6..f141925 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ 4.0.0 - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT org.questdb rust-maven pom diff --git a/rust-maven-jna-example/pom.xml b/rust-maven-jna-example/pom.xml index b84aad2..37b4de2 100644 --- a/rust-maven-jna-example/pom.xml +++ b/rust-maven-jna-example/pom.xml @@ -27,7 +27,7 @@ org.questdb rust-maven-jna-example - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT jar Rust Maven Plugin JNA Usage Example diff --git a/rust-maven-jni-example/pom.xml b/rust-maven-jni-example/pom.xml index e7e5981..c08eff8 100644 --- a/rust-maven-jni-example/pom.xml +++ b/rust-maven-jni-example/pom.xml @@ -22,12 +22,12 @@ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> - + 4.0.0 org.questdb rust-maven-jni-example - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT jar Rust Maven Plugin Usage Example @@ -169,6 +169,20 @@ + + + dummy + + build + + + true + required, but not evaluated if skipped + + diff --git a/rust-maven-plugin/pom.xml b/rust-maven-plugin/pom.xml index 6aa55ff..d30ca14 100644 --- a/rust-maven-plugin/pom.xml +++ b/rust-maven-plugin/pom.xml @@ -27,7 +27,7 @@ org.questdb rust-maven-plugin - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT maven-plugin Rust Maven Plugin diff --git a/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoBuildMojo.java b/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoBuildMojo.java index e749c34..e8b6d0c 100644 --- a/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoBuildMojo.java +++ b/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoBuildMojo.java @@ -58,6 +58,10 @@ public class CargoBuildMojo extends CargoMojoBase { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (skip) { + getLog().info("Skipping build"); + return; + } final Crate crate = new Crate( getCrateRoot(), getTargetRootDir(), diff --git a/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoMojoBase.java b/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoMojoBase.java index 61e14dc..2ec92dc 100644 --- a/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoMojoBase.java +++ b/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoMojoBase.java @@ -38,6 +38,15 @@ public abstract class CargoMojoBase extends AbstractMojo { @Parameter(property = "project", readonly = true) protected MavenProject project; + /** + * Skip this configured execution. + */ + @Parameter(property = "skip", defaultValue = "false") + protected boolean skip; + + /** + * Additional environment variables set when running `cargo`. + */ @Parameter(property = "environmentVariables") private HashMap environmentVariables; diff --git a/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoTestMojo.java b/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoTestMojo.java index 8ba7511..5faa1cc 100644 --- a/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoTestMojo.java +++ b/rust-maven-plugin/src/main/java/io/questdb/maven/rust/CargoTestMojo.java @@ -40,7 +40,7 @@ public class CargoTestMojo extends CargoMojoBase { @Override public void execute() throws MojoExecutionException, MojoFailureException { - if (skipTests) { + if (skip || skipTests) { getLog().info("Skipping tests"); return; }