This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch mvnd-1.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git

commit 625e7df57e6730d576b76d39d6ae5c29ec838f4d
Author: Tamas Cservenak <[email protected]>
AuthorDate: Wed May 22 16:33:29 2024 +0200

    Default value must be manually handled (#953)
    
    (cherry picked from commit 6de743152c6ba5900462bcfbcd6ff0a353b70574)
    Only the integration tests are taken, the fix is already on this branch; 
kept the 1.x interpolation and multiModuleProjectDirectory tests next to the 
new mvndParams() hook.
---
 .../mvnd/it/MavenConfIgnoreExtDefNativeIT.java     | 34 +++++++++++++++++
 .../mvnd/it/MavenConfIgnoreExtDefTest.java         | 27 +++++++++++++
 .../mvnd/it/MavenConfIgnoreExtNativeIT.java        | 44 ++++++++++++++++++++++
 .../mvndaemon/mvnd/it/MavenConfIgnoreExtTest.java  | 24 ++++++++++++
 .../org/mvndaemon/mvnd/it/MavenConfNativeIT.java   | 23 ++++++-----
 .../maven-conf-ignore-ext-def/.mvn/extensions.xml  |  9 +++++
 .../projects/maven-conf-ignore-ext-def/pom.xml     | 27 +++++++++++++
 .../maven-conf-ignore-ext/.mvn/extensions.xml      |  9 +++++
 .../test/projects/maven-conf-ignore-ext/pom.xml    | 27 +++++++++++++
 9 files changed, 215 insertions(+), 9 deletions(-)

diff --git 
a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtDefNativeIT.java
 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtDefNativeIT.java
new file mode 100644
index 00000000..e4d9e357
--- /dev/null
+++ 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtDefNativeIT.java
@@ -0,0 +1,34 @@
+/*
+ * 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.mvndaemon.mvnd.it;
+
+import org.junit.jupiter.api.Disabled;
+import org.mvndaemon.mvnd.junit.MvndNativeTest;
+
+@MvndNativeTest(projectDir = "src/test/projects/maven-conf-ignore-ext-def")
+class MavenConfIgnoreExtDefNativeIT extends MavenConfNativeIT {
+    // these 1.x tests rely on the .mvn/maven.config of the maven-conf project
+    @Override
+    @Disabled("needs the maven-conf project configuration")
+    void interpolation() {}
+
+    @Override
+    @Disabled("needs the maven-conf project configuration")
+    void multiModuleProjectDirectory() {}
+}
diff --git 
a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtDefTest.java
 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtDefTest.java
new file mode 100644
index 00000000..ff6608a9
--- /dev/null
+++ 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtDefTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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.mvndaemon.mvnd.it;
+
+import org.junit.jupiter.api.condition.DisabledOnOs;
+import org.junit.jupiter.api.condition.OS;
+import org.mvndaemon.mvnd.junit.MvndTest;
+
+@DisabledOnOs(OS.LINUX)
+@MvndTest(projectDir = "src/test/projects/maven-conf-ignore-ext-def")
+class MavenConfIgnoreExtDefTest extends MavenConfIgnoreExtDefNativeIT {}
diff --git 
a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtNativeIT.java
 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtNativeIT.java
new file mode 100644
index 00000000..cc6e4360
--- /dev/null
+++ 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtNativeIT.java
@@ -0,0 +1,44 @@
+/*
+ * 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.mvndaemon.mvnd.it;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.jupiter.api.Disabled;
+import org.mvndaemon.mvnd.junit.MvndNativeTest;
+
+@MvndNativeTest(projectDir = "src/test/projects/maven-conf-ignore-ext")
+class MavenConfIgnoreExtNativeIT extends MavenConfNativeIT {
+    @Override
+    protected List<String> mvndParams() {
+        ArrayList<String> result = new ArrayList<>(super.mvndParams());
+        result.add("-Dmvnd.coreExtensionsExclude=foo:bar");
+        return result;
+    }
+
+    // these 1.x tests rely on the .mvn/maven.config of the maven-conf project
+    @Override
+    @Disabled("needs the maven-conf project configuration")
+    void interpolation() {}
+
+    @Override
+    @Disabled("needs the maven-conf project configuration")
+    void multiModuleProjectDirectory() {}
+}
diff --git 
a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtTest.java
 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtTest.java
new file mode 100644
index 00000000..3df1990c
--- /dev/null
+++ 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfIgnoreExtTest.java
@@ -0,0 +1,24 @@
+/*
+ * 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.mvndaemon.mvnd.it;
+
+import org.mvndaemon.mvnd.junit.MvndTest;
+
+@MvndTest(projectDir = "src/test/projects/maven-conf-ignore-ext")
+class MavenConfIgnoreExtTest extends MavenConfIgnoreExtNativeIT {}
diff --git 
a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java
index aa0f1b0d..ae8876c7 100644
--- 
a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java
+++ 
b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java
@@ -21,6 +21,8 @@ package org.mvndaemon.mvnd.it;
 import javax.inject.Inject;
 
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
 
 import org.junit.jupiter.api.Test;
 import org.mvndaemon.mvnd.assertj.TestClientOutput;
@@ -43,15 +45,7 @@ class MavenConfNativeIT {
     void version() throws IOException, InterruptedException {
         final TestClientOutput o = new TestClientOutput();
         // this test also exercise the "-D foo=bar" syntax for defining 
properties
-        client.execute(
-                        o,
-                        
"org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate",
-                        "-D",
-                        "expression=maven.conf",
-                        "-q",
-                        "-DforceStdout",
-                        "--raw-streams")
-                .assertSuccess();
+        client.execute(o, mvndParams().toArray(new String[0])).assertSuccess();
         String conf = 
parameters.mvndHome().resolve("mvn").resolve("conf").toString();
         assertTrue(
                 o.getMessages().stream().anyMatch(m -> 
m.toString().contains(conf)), "Output should contain " + conf);
@@ -90,4 +84,15 @@ class MavenConfNativeIT {
         assertTrue(
                 o.getMessages().stream().anyMatch(m -> 
m.toString().contains(conf)), "Output should contain " + conf);
     }
+
+    protected List<String> mvndParams() {
+        return Arrays.asList(
+                "org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate",
+                "-D",
+                "expression=maven.conf",
+                "-q",
+                "-DforceStdout",
+                "--raw-streams",
+                "-X");
+    }
 }
diff --git 
a/integration-tests/src/test/projects/maven-conf-ignore-ext-def/.mvn/extensions.xml
 
b/integration-tests/src/test/projects/maven-conf-ignore-ext-def/.mvn/extensions.xml
new file mode 100644
index 00000000..640cfc12
--- /dev/null
+++ 
b/integration-tests/src/test/projects/maven-conf-ignore-ext-def/.mvn/extensions.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extensions>
+    <!-- By def ignored: basically the build should "just work" -->
+    <extension>
+        <groupId>io.takari.maven</groupId>
+        <artifactId>takari-smart-builder</artifactId>
+        <version>0.6.4</version>
+    </extension>
+</extensions>
\ No newline at end of file
diff --git 
a/integration-tests/src/test/projects/maven-conf-ignore-ext-def/pom.xml 
b/integration-tests/src/test/projects/maven-conf-ignore-ext-def/pom.xml
new file mode 100644
index 00000000..6a1c209f
--- /dev/null
+++ b/integration-tests/src/test/projects/maven-conf-ignore-ext-def/pom.xml
@@ -0,0 +1,27 @@
+<!--
+
+    Copyright 2019-2022 the original author or authors.
+
+    Licensed 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.
+
+-->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://maven.apache.org/POM/4.0.0";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.mvndaemon.mvnd.test.maven-conf</groupId>
+    <artifactId>maven-conf-ignore-ext-def</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+ </project>
\ No newline at end of file
diff --git 
a/integration-tests/src/test/projects/maven-conf-ignore-ext/.mvn/extensions.xml 
b/integration-tests/src/test/projects/maven-conf-ignore-ext/.mvn/extensions.xml
new file mode 100644
index 00000000..ae56bd22
--- /dev/null
+++ 
b/integration-tests/src/test/projects/maven-conf-ignore-ext/.mvn/extensions.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extensions>
+    <!-- nonexistent: if not ignored, will explode -->
+    <extension>
+        <groupId>foo</groupId>
+        <artifactId>bar</artifactId>
+        <version>1.0.0</version>
+    </extension>
+</extensions>
\ No newline at end of file
diff --git a/integration-tests/src/test/projects/maven-conf-ignore-ext/pom.xml 
b/integration-tests/src/test/projects/maven-conf-ignore-ext/pom.xml
new file mode 100644
index 00000000..fb803ed4
--- /dev/null
+++ b/integration-tests/src/test/projects/maven-conf-ignore-ext/pom.xml
@@ -0,0 +1,27 @@
+<!--
+
+    Copyright 2019-2022 the original author or authors.
+
+    Licensed 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.
+
+-->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://maven.apache.org/POM/4.0.0";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.mvndaemon.mvnd.test.maven-conf</groupId>
+    <artifactId>maven-conf-ignore-ext</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+ </project>
\ No newline at end of file

Reply via email to