From 9de37dbf27842a0036abf068d53ad34a21d66228 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Sun, 8 Dec 2024 22:45:53 +0100 Subject: [PATCH] [MNG-8410] API cleanup * Move plugin api to maven-api-plugin * Rename maven-api-meta to maven-api-annotations --- .../pom.xml | 2 +- .../apache/maven/api/annotations/Config.java | 0 .../maven/api/annotations/Consumer.java | 0 .../maven/api/annotations/Experimental.java | 0 .../maven/api/annotations/Generated.java | 0 .../maven/api/annotations/Immutable.java | 0 .../apache/maven/api/annotations/Nonnull.java | 0 .../maven/api/annotations/NotThreadSafe.java | 0 .../maven/api/annotations/Nullable.java | 0 .../maven/api/annotations/Provider.java | 0 .../maven/api/annotations/ThreadSafe.java | 0 .../maven/api/annotations/package-info.java | 0 .../src/site/site.xml | 0 api/maven-api-cli/pom.xml | 2 +- api/maven-api-core/pom.xml | 2 +- .../java/org/apache/maven/api/Constants.java | 47 ++++++++++++ .../apache/maven/api/feature/Features.java | 76 ------------------- api/maven-api-metadata/pom.xml | 2 +- api/maven-api-model/pom.xml | 2 +- api/maven-api-plugin/pom.xml | 2 +- .../maven/api/plugin/LifecycleProvider.java | 0 .../java/org/apache/maven/api/plugin/Log.java | 0 .../org/apache/maven/api/plugin/Mojo.java | 0 .../maven/api/plugin/MojoException.java | 0 .../maven/api/plugin/annotations/After.java | 0 .../maven/api/plugin/annotations/Execute.java | 0 .../maven/api/plugin/annotations/Mojo.java | 0 .../api/plugin/annotations/Parameter.java | 0 .../api/plugin/annotations/Resolution.java | 0 .../api/plugin/annotations/package-info.java | 5 ++ .../apache/maven/api/plugin/package-info.java | 5 ++ api/maven-api-settings/pom.xml | 2 +- api/maven-api-spi/pom.xml | 2 +- api/maven-api-toolchain/pom.xml | 2 +- api/maven-api-xml/pom.xml | 2 +- api/pom.xml | 2 +- compat/maven-model-builder/pom.xml | 2 +- compat/maven-model/pom.xml | 2 +- compat/maven-plugin-api/pom.xml | 2 +- compat/maven-repository-metadata/pom.xml | 2 +- compat/maven-settings/pom.xml | 2 +- compat/maven-toolchain-model/pom.xml | 2 +- .../java/org/apache/maven/ReactorReader.java | 6 +- ...DefaultConsumerPomArtifactTransformer.java | 12 ++- .../resources/META-INF/maven/extension.xml | 2 +- impl/maven-di/pom.xml | 2 +- impl/maven-executor/pom.xml | 2 +- impl/maven-impl/pom.xml | 2 +- impl/maven-jline/pom.xml | 2 +- its/pom.xml | 2 +- pom.xml | 2 +- 51 files changed, 93 insertions(+), 106 deletions(-) rename api/{maven-api-meta => maven-api-annotations}/pom.xml (96%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Config.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Consumer.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Experimental.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Generated.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Immutable.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Nonnull.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/NotThreadSafe.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Nullable.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/Provider.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/ThreadSafe.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/main/java/org/apache/maven/api/annotations/package-info.java (100%) rename api/{maven-api-meta => maven-api-annotations}/src/site/site.xml (100%) delete mode 100644 api/maven-api-core/src/main/java/org/apache/maven/api/feature/Features.java rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/LifecycleProvider.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/Log.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/Mojo.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/MojoException.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/annotations/After.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java (100%) rename api/{maven-api-core => maven-api-plugin}/src/main/java/org/apache/maven/api/plugin/annotations/Resolution.java (100%) create mode 100644 api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/package-info.java create mode 100644 api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/package-info.java diff --git a/api/maven-api-meta/pom.xml b/api/maven-api-annotations/pom.xml similarity index 96% rename from api/maven-api-meta/pom.xml rename to api/maven-api-annotations/pom.xml index 7f0f89b179cc..f5e9286ec219 100644 --- a/api/maven-api-meta/pom.xml +++ b/api/maven-api-annotations/pom.xml @@ -26,7 +26,7 @@ 4.0.0-rc-2-SNAPSHOT - maven-api-meta + maven-api-annotations Maven 4 API :: Meta annotations Maven 4 API - Java meta annotations. diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Config.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Config.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Config.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Config.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Consumer.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Consumer.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Consumer.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Consumer.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Experimental.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Experimental.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Experimental.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Experimental.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Generated.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Generated.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Generated.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Generated.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Immutable.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Immutable.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Immutable.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Immutable.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Nonnull.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Nonnull.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Nonnull.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Nonnull.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/NotThreadSafe.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/NotThreadSafe.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/NotThreadSafe.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/NotThreadSafe.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Nullable.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Nullable.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Nullable.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Nullable.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Provider.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Provider.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/Provider.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/Provider.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/ThreadSafe.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/ThreadSafe.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/ThreadSafe.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/ThreadSafe.java diff --git a/api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/package-info.java b/api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/package-info.java similarity index 100% rename from api/maven-api-meta/src/main/java/org/apache/maven/api/annotations/package-info.java rename to api/maven-api-annotations/src/main/java/org/apache/maven/api/annotations/package-info.java diff --git a/api/maven-api-meta/src/site/site.xml b/api/maven-api-annotations/src/site/site.xml similarity index 100% rename from api/maven-api-meta/src/site/site.xml rename to api/maven-api-annotations/src/site/site.xml diff --git a/api/maven-api-cli/pom.xml b/api/maven-api-cli/pom.xml index 3672d45dab6b..f6752154668b 100644 --- a/api/maven-api-cli/pom.xml +++ b/api/maven-api-cli/pom.xml @@ -33,7 +33,7 @@ org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/api/maven-api-core/pom.xml b/api/maven-api-core/pom.xml index 4f60c0eb8990..ae950fbb480c 100644 --- a/api/maven-api-core/pom.xml +++ b/api/maven-api-core/pom.xml @@ -33,7 +33,7 @@ org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java b/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java index a5bebc73f43f..c18ff3019b07 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java @@ -19,6 +19,10 @@ package org.apache.maven.api; import org.apache.maven.api.annotations.Config; +import org.apache.maven.api.annotations.Nonnull; +import org.apache.maven.api.annotations.Nullable; + +import java.util.Map; /** * Configuration constants. @@ -432,5 +436,48 @@ public final class Constants { @Config(type = "java.lang.Integer") public static final String MAVEN_DEPLOY_SNAPSHOT_BUILD_NUMBER = "maven.deploy.snapshot.buildNumber"; + + /** + * Check if the given feature is active. + */ + public static boolean isEnabled(@Nullable Map userProperties, @Nonnull String key) { + return doGet(userProperties, key, false); + } + + /** + * Check if the given feature is active. + */ + public static boolean isEnabled(@Nullable Map userProperties, @Nonnull String key, boolean def) { + return doGet(userProperties, key, def); + } + + /** + * Check if the consumer POM feature is active. + */ + public static boolean isEnabled(@Nullable Session session, @Nonnull String key) { + return isEnabled(session != null ? session.getUserProperties() : null, key); + } + + /** + * Check if the consumer POM feature is active. + */ + public static boolean isEnabled(@Nullable Session session, @Nonnull String key, boolean def) { + return isEnabled(session != null ? session.getUserProperties() : null, key, def); + } + + private static boolean doGet(Map userProperties, String key, boolean def) { + return doGet(userProperties != null ? userProperties.get(key) : null, def); + } + + private static boolean doGet(Object val, boolean def) { + if (val instanceof Boolean) { + return (Boolean) val; + } else if (val != null) { + return Boolean.parseBoolean(val.toString()); + } else { + return def; + } + } + private Constants() {} } diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/feature/Features.java b/api/maven-api-core/src/main/java/org/apache/maven/api/feature/Features.java deleted file mode 100644 index c88b239f2800..000000000000 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/feature/Features.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.api.feature; - -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.api.Constants; -import org.apache.maven.api.Session; -import org.apache.maven.api.annotations.Nullable; - -/** - * Centralized class for Maven Core feature information. - * Features configured are supposed to be final in a given maven session. - * - * @since 4.0.0 - */ -public final class Features { - - private Features() {} - - /** - * Check if the consumer POM feature is active. - */ - public static boolean consumerPom(@Nullable Properties userProperties) { - return doGet(userProperties, Constants.MAVEN_CONSUMER_POM, true); - } - - /** - * Check if the consumer POM feature is active. - */ - public static boolean consumerPom(@Nullable Map userProperties) { - return doGet(userProperties, Constants.MAVEN_CONSUMER_POM, true); - } - - /** - * Check if the consumer POM feature is active. - */ - public static boolean consumerPom(@Nullable Session session) { - return consumerPom(session != null ? session.getUserProperties() : null); - } - - private static boolean doGet(Properties userProperties, String key, boolean def) { - return doGet(userProperties != null ? userProperties.get(key) : null, def); - } - - private static boolean doGet(Map userProperties, String key, boolean def) { - return doGet(userProperties != null ? userProperties.get(key) : null, def); - } - - private static boolean doGet(Object val, boolean def) { - if (val instanceof Boolean) { - return (Boolean) val; - } else if (val != null) { - return Boolean.parseBoolean(val.toString()); - } else { - return def; - } - } -} diff --git a/api/maven-api-metadata/pom.xml b/api/maven-api-metadata/pom.xml index 234e35cf3856..e16eaa0fe3eb 100644 --- a/api/maven-api-metadata/pom.xml +++ b/api/maven-api-metadata/pom.xml @@ -33,7 +33,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations diff --git a/api/maven-api-model/pom.xml b/api/maven-api-model/pom.xml index 37c67d1a569d..517e76e87cc8 100644 --- a/api/maven-api-model/pom.xml +++ b/api/maven-api-model/pom.xml @@ -34,7 +34,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/api/maven-api-plugin/pom.xml b/api/maven-api-plugin/pom.xml index 789384ee30d8..420203ceecf7 100644 --- a/api/maven-api-plugin/pom.xml +++ b/api/maven-api-plugin/pom.xml @@ -33,7 +33,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/LifecycleProvider.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/LifecycleProvider.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/LifecycleProvider.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/LifecycleProvider.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/Log.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/Log.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/Log.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/Log.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/Mojo.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/Mojo.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/Mojo.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/Mojo.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/MojoException.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/MojoException.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/MojoException.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/MojoException.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/After.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/After.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/After.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/After.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Resolution.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Resolution.java similarity index 100% rename from api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Resolution.java rename to api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/Resolution.java diff --git a/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/package-info.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/package-info.java new file mode 100644 index 000000000000..5a4ed7d59d4b --- /dev/null +++ b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/annotations/package-info.java @@ -0,0 +1,5 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Maven Plugin Annotations. + */ +package org.apache.maven.api.plugin.annotations; diff --git a/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/package-info.java b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/package-info.java new file mode 100644 index 000000000000..1aaa794cbd1a --- /dev/null +++ b/api/maven-api-plugin/src/main/java/org/apache/maven/api/plugin/package-info.java @@ -0,0 +1,5 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Maven Plugin API. + */ +package org.apache.maven.api.plugin; diff --git a/api/maven-api-settings/pom.xml b/api/maven-api-settings/pom.xml index 8179ad33cc9e..debfd995553c 100644 --- a/api/maven-api-settings/pom.xml +++ b/api/maven-api-settings/pom.xml @@ -34,7 +34,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/api/maven-api-spi/pom.xml b/api/maven-api-spi/pom.xml index ef6e5b3ba17d..18ef646d9193 100644 --- a/api/maven-api-spi/pom.xml +++ b/api/maven-api-spi/pom.xml @@ -33,7 +33,7 @@ org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/api/maven-api-toolchain/pom.xml b/api/maven-api-toolchain/pom.xml index 8d22b6a775b4..d5f7bd1f7c63 100644 --- a/api/maven-api-toolchain/pom.xml +++ b/api/maven-api-toolchain/pom.xml @@ -33,7 +33,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/api/maven-api-xml/pom.xml b/api/maven-api-xml/pom.xml index 4e70f3e57b8c..41513a4567b4 100644 --- a/api/maven-api-xml/pom.xml +++ b/api/maven-api-xml/pom.xml @@ -33,7 +33,7 @@ org.apache.maven - maven-api-meta + maven-api-annotations diff --git a/api/pom.xml b/api/pom.xml index cff05ae1e3fa..5820308ffaba 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -32,7 +32,7 @@ A new immutable API for Maven 4 to better manage what plugins and extensions can influence. - maven-api-meta + maven-api-annotations maven-api-di maven-api-xml maven-api-model diff --git a/compat/maven-model-builder/pom.xml b/compat/maven-model-builder/pom.xml index 3e4e2ed80244..db82a8ba62f9 100644 --- a/compat/maven-model-builder/pom.xml +++ b/compat/maven-model-builder/pom.xml @@ -53,7 +53,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/compat/maven-model/pom.xml b/compat/maven-model/pom.xml index cd35ba596648..4f234d5d5664 100644 --- a/compat/maven-model/pom.xml +++ b/compat/maven-model/pom.xml @@ -44,7 +44,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/compat/maven-plugin-api/pom.xml b/compat/maven-plugin-api/pom.xml index 463438212d24..dd155374d458 100644 --- a/compat/maven-plugin-api/pom.xml +++ b/compat/maven-plugin-api/pom.xml @@ -40,7 +40,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/compat/maven-repository-metadata/pom.xml b/compat/maven-repository-metadata/pom.xml index 50e5a033368e..c1aedc5197af 100644 --- a/compat/maven-repository-metadata/pom.xml +++ b/compat/maven-repository-metadata/pom.xml @@ -36,7 +36,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/compat/maven-settings/pom.xml b/compat/maven-settings/pom.xml index 89a91e7dffd7..52b9ea8e2f2c 100644 --- a/compat/maven-settings/pom.xml +++ b/compat/maven-settings/pom.xml @@ -44,7 +44,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/compat/maven-toolchain-model/pom.xml b/compat/maven-toolchain-model/pom.xml index 7d4c2466e959..441a4135dd22 100644 --- a/compat/maven-toolchain-model/pom.xml +++ b/compat/maven-toolchain-model/pom.xml @@ -43,7 +43,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.codehaus.plexus diff --git a/impl/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/impl/maven-core/src/main/java/org/apache/maven/ReactorReader.java index ea4af1e9863b..0f57d973c35e 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/impl/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -39,11 +39,12 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.maven.api.feature.Features; +import org.apache.maven.api.Constants; import org.apache.maven.api.model.Model; import org.apache.maven.api.services.Lookup; import org.apache.maven.eventspy.EventSpy; @@ -415,7 +416,8 @@ private boolean isRegularFile(Artifact artifact) { private void installIntoProjectLocalRepository(Artifact artifact) { String extension = artifact.getExtension(); String classifier = artifact.getClassifier(); - if (Features.consumerPom(session.getUserProperties())) { + Properties userProperties = session.getUserProperties(); + if (Constants.isEnabled(userProperties, Constants.MAVEN_CONSUMER_POM, true)) { if ("pom".equals(extension)) { if (classifier == null || classifier.isEmpty()) { classifier = "build"; diff --git a/impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomArtifactTransformer.java b/impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomArtifactTransformer.java index 60865274a045..fecffa7b5de8 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomArtifactTransformer.java +++ b/impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomArtifactTransformer.java @@ -31,10 +31,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; -import org.apache.maven.api.feature.Features; +import org.apache.maven.api.Constants; import org.apache.maven.api.model.Model; import org.apache.maven.api.services.ModelBuilderException; import org.apache.maven.internal.transformation.ConsumerPomArtifactTransformer; @@ -80,7 +81,8 @@ public void injectTransformedArtifacts(RepositorySystemSession session, MavenPro // If there is no build POM there is no reason to inject artifacts for the consumer POM. return; } - if (Features.consumerPom(session.getUserProperties())) { + Map userProperties = session.getUserProperties(); + if (Constants.isEnabled(userProperties, Constants.MAVEN_CONSUMER_POM, true)) { Path buildDir = project.getBuild() != null ? Paths.get(project.getBuild().getDirectory()) : null; if (buildDir != null) { @@ -133,14 +135,16 @@ private void doDeleteFiles() { } public InstallRequest remapInstallArtifacts(RepositorySystemSession session, InstallRequest request) { - if (Features.consumerPom(session.getUserProperties()) && consumerPomPresent(request.getArtifacts())) { + Map userProperties = session.getUserProperties(); + if (Constants.isEnabled(userProperties, Constants.MAVEN_CONSUMER_POM, true) && consumerPomPresent(request.getArtifacts())) { request.setArtifacts(replacePom(request.getArtifacts())); } return request; } public DeployRequest remapDeployArtifacts(RepositorySystemSession session, DeployRequest request) { - if (Features.consumerPom(session.getUserProperties()) && consumerPomPresent(request.getArtifacts())) { + Map userProperties = session.getUserProperties(); + if (Constants.isEnabled(userProperties, Constants.MAVEN_CONSUMER_POM, true) && consumerPomPresent(request.getArtifacts())) { request.setArtifacts(replacePom(request.getArtifacts())); } return request; diff --git a/impl/maven-core/src/main/resources/META-INF/maven/extension.xml b/impl/maven-core/src/main/resources/META-INF/maven/extension.xml index 454115ecdcfc..60d27530fc38 100644 --- a/impl/maven-core/src/main/resources/META-INF/maven/extension.xml +++ b/impl/maven-core/src/main/resources/META-INF/maven/extension.xml @@ -144,9 +144,9 @@ under the License. + org.apache.maven:maven-api-annotations org.apache.maven:maven-api-core org.apache.maven:maven-api-di - org.apache.maven:maven-api-meta org.apache.maven:maven-api-metadata org.apache.maven:maven-api-model org.apache.maven:maven-api-plugin diff --git a/impl/maven-di/pom.xml b/impl/maven-di/pom.xml index 8161f270122c..17d921b6a36f 100644 --- a/impl/maven-di/pom.xml +++ b/impl/maven-di/pom.xml @@ -38,7 +38,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations diff --git a/impl/maven-executor/pom.xml b/impl/maven-executor/pom.xml index 104708291417..4e1060714b55 100644 --- a/impl/maven-executor/pom.xml +++ b/impl/maven-executor/pom.xml @@ -41,7 +41,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations provided diff --git a/impl/maven-impl/pom.xml b/impl/maven-impl/pom.xml index 533c28508254..8328c9a1982f 100644 --- a/impl/maven-impl/pom.xml +++ b/impl/maven-impl/pom.xml @@ -63,7 +63,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/impl/maven-jline/pom.xml b/impl/maven-jline/pom.xml index d60bb9041718..fec3504f8214 100644 --- a/impl/maven-jline/pom.xml +++ b/impl/maven-jline/pom.xml @@ -34,7 +34,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations org.apache.maven diff --git a/its/pom.xml b/its/pom.xml index ae5cbdd8a4b9..30b75a67d77d 100644 --- a/its/pom.xml +++ b/its/pom.xml @@ -131,7 +131,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations ${maven-version} diff --git a/pom.xml b/pom.xml index aff5740daa38..4f623a44b7d6 100644 --- a/pom.xml +++ b/pom.xml @@ -230,7 +230,7 @@ under the License. org.apache.maven - maven-api-meta + maven-api-annotations ${project.version}