diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/AbstractTychoPackagingMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/AbstractTychoPackagingMojo.java index 4f8e3d840c..a7cbccba4f 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/AbstractTychoPackagingMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/AbstractTychoPackagingMojo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2022 Sonatype Inc. and others. + * Copyright (c) 2008, 2024 Sonatype Inc. and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -93,6 +93,10 @@ public abstract class AbstractTychoPackagingMojo extends AbstractMojo { @Parameter protected DefaultFileSet[] additionalFileSets; + /** If {@code true}, skips the packaging entirely. */ + @Parameter(defaultValue = "false") + protected boolean skip; + @Component protected PlexusContainer plexus; diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java index 3594c8da9c..933b7f7768 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2022 Sonatype Inc. and others. + * Copyright (c) 2008, 2024 Sonatype Inc. and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -119,6 +119,10 @@ public class PackageFeatureMojo extends AbstractTychoPackagingMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (skip) { + getLog().info("Skip packaging"); + return; + } synchronized (LOCK) { outputDirectory.mkdirs(); diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageIUMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageIUMojo.java index a9a2d5c160..9cd2d65d91 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageIUMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageIUMojo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Rapicorp, Inc. and others. + * Copyright (c) 2015, 2024 Rapicorp, Inc. and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -61,6 +61,10 @@ public class PackageIUMojo extends AbstractTychoPackagingMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (skip) { + getLog().info("Skip packaging"); + return; + } synchronized (LOCK) { outputDirectory.mkdirs(); diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java index dd34240393..debb862271 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java @@ -179,7 +179,10 @@ public class PackagePluginMojo extends AbstractTychoPackagingMojo { @Override public void execute() throws MojoExecutionException { - + if (skip) { + getLog().info("skip packaging"); + return; + } Optional pde = projectManager.getTychoProject(project) .filter(BundleProject.class::isInstance) .map(BundleProject.class::cast)