elharo commented on code in PR #2380:
URL: https://github.com/apache/maven/pull/2380#discussion_r2105406184
##########
api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java:
##########
@@ -462,6 +462,15 @@ public final class Constants {
@Config(type = "java.lang.Boolean", defaultValue = "true")
public static final String MAVEN_CONSUMER_POM = "maven.consumer.pom";
+ /**
+ * User property for controlling "maven personality". If set to {@code
true} Maven will behave
+ * as previous major version, Maven 3.
+ *
+ * @since 4.0.0
+ */
+ @Config(type = "java.lang.Boolean", defaultValue = "false")
Review Comment:
MAVEN_MAVEN3_PERSONALITY sounds weird and duplicative. Maybe just
MAVEN3_PERSONALITY?
##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/ModelBuilder.java:
##########
@@ -29,7 +29,7 @@ public interface ModelBuilder extends Service {
String MODEL_VERSION_4_1_0 = "4.1.0";
- List<String> VALID_MODEL_VERSIONS = List.of(MODEL_VERSION_4_0_0,
MODEL_VERSION_4_1_0);
+ List<String> ALL_KNOWN_MODEL_VERSIONS = List.of(MODEL_VERSION_4_0_0,
MODEL_VERSION_4_1_0);
Review Comment:
KNOWN_MODEL_VERSIONS (delete ALL_)
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:
##########
@@ -0,0 +1,67 @@
+/*
+ * 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.internal.transformation.impl;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+import javax.xml.stream.XMLStreamException;
+
+import java.io.IOException;
+import java.nio.file.Path;
+
+import org.apache.maven.api.feature.Features;
+import org.apache.maven.api.services.ModelBuilderException;
+import org.apache.maven.internal.transformation.PomArtifactTransformer;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.installation.InstallRequest;
+
+/**
+ * Inliner POM transformer.
+ *
+ * @since TBD
+ */
+@Singleton
+@Named
+class PomInlinerTransformer implements PomArtifactTransformer {
+ @Override
+ public InstallRequest remapInstallArtifacts(RepositorySystemSession
session, InstallRequest request) {
+ return request;
+ }
+
+ @Override
+ public DeployRequest remapDeployArtifacts(RepositorySystemSession session,
DeployRequest request) {
+ return request;
+ }
+
+ @Override
+ public void injectTransformedArtifacts(RepositorySystemSession session,
MavenProject currentProject)
+ throws IOException {
+ if (!Features.consumerPom(session.getConfigProperties())) {
+ // TODO
Review Comment:
do this here?
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java:
##########
@@ -302,7 +304,7 @@ public DefaultModelValidator() {}
@Override
@SuppressWarnings("checkstyle:MethodLength")
- public void validateFileModel(Model m, int validationLevel,
ModelProblemCollector problems) {
+ public void validateFileModel(Session s, Model m, int validationLevel,
ModelProblemCollector problems) {
Review Comment:
s --> session
wouldn't hurt to rename m to model too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]