From b8e32dcaeabf99543eff34226e2f7b4cef981d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 16 Dec 2023 08:38:34 +0100 Subject: [PATCH] Unify the profile name across mojos (cherry picked from commit bd2796da5dca5c2474b7346235d4189903714cd9) --- .../src/main/java/org/eclipse/tycho/TychoConstants.java | 1 + .../org/eclipse/tycho/plugins/p2/director/DirectorMojo.java | 5 +++-- .../tycho/plugins/p2/director/MaterializeProductsMojo.java | 3 ++- .../org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java | 3 +-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java b/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java index e6aed98a95..fc43b3d49c 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java @@ -82,6 +82,7 @@ public interface TychoConstants { String PROP_PGP_SIGNATURES = "pgp.signatures"; + String DEFAULT_PROFILE = "DefaultProfile"; /** * @deprecated this is deprecated but can't be removed as we otherwise loose compatibility for * older repository format, this should never be used in new code and usage should diff --git a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java index ccc5e9d9b2..71a2cb459a 100644 --- a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java +++ b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java @@ -37,6 +37,7 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.core.IProvisioningAgentProvider; import org.eclipse.equinox.p2.core.ProvisionException; +import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.p2.CommandLineArguments; import org.eclipse.tycho.p2.resolver.BundlePublisher; import org.eclipse.tycho.p2tools.TychoDirectorApplication; @@ -205,7 +206,7 @@ public class DirectorMojo extends AbstractMojo { /** * Defines what profile to use for the actions. */ - @Parameter(property = "profile") + @Parameter(property = "profile", defaultValue = TychoConstants.DEFAULT_PROFILE) private String profile; /** @@ -216,7 +217,7 @@ public class DirectorMojo extends AbstractMojo { @Parameter(property = "profileproperties") private String profileproperties; - @Parameter(property = "installFeatures") + @Parameter(property = "installFeatures", defaultValue = "true") private boolean installFeatures; /** diff --git a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/MaterializeProductsMojo.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/MaterializeProductsMojo.java index bbdd9b93b0..b481e5a4a9 100644 --- a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/MaterializeProductsMojo.java +++ b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/MaterializeProductsMojo.java @@ -23,6 +23,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.eclipse.tycho.TargetEnvironment; +import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.core.resolver.shared.DependencySeed; import org.eclipse.tycho.p2.tools.RepositoryReferences; import org.eclipse.tycho.p2.tools.director.shared.DirectorCommandException; @@ -59,7 +60,7 @@ public enum DirectorRuntimeType { /** * The name of the p2 profile to be created. */ - @Parameter(defaultValue = "DefaultProfile") + @Parameter(defaultValue = TychoConstants.DEFAULT_PROFILE) private String profile; // TODO 405785 the syntax of this parameter doesn't work well with configuration inheritance; replace with new generic envSpecificConfiguration parameter syntax diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java index ca3159fd6d..d34d88dea3 100644 --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java @@ -522,8 +522,7 @@ public abstract class AbstractEclipseTestMojo extends AbstractTestMojo { * * @since 0.19.0 */ - // default value should be kept the same as DirectorMojo#profile default value - @Parameter(defaultValue = "DefaultProfile") + @Parameter(defaultValue = TychoConstants.DEFAULT_PROFILE) private String profileName; /**