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

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-install-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 76c7702  [MINSTALL-206] Add IT to verify that phase=none skips 
execution without errors (#340, closes #317)
76c7702 is described below

commit 76c7702c33a0207e084de35930433b5db5ad3c61
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Thu Apr 3 18:35:57 2025 +0200

    [MINSTALL-206] Add IT to verify that phase=none skips execution without 
errors (#340, closes #317)
---
 src/it/MINSTALL-206/invoker.properties        | 18 ++++++++++
 src/it/MINSTALL-206/module-phase-none/pom.xml | 47 +++++++++++++++++++++++++++
 src/it/MINSTALL-206/module-skip-true/pom.xml  | 44 +++++++++++++++++++++++++
 src/it/MINSTALL-206/pom.xml                   | 46 ++++++++++++++++++++++++++
 src/it/MINSTALL-206/verify.groovy             | 38 ++++++++++++++++++++++
 5 files changed, 193 insertions(+)

diff --git a/src/it/MINSTALL-206/invoker.properties 
b/src/it/MINSTALL-206/invoker.properties
new file mode 100644
index 0000000..73ed836
--- /dev/null
+++ b/src/it/MINSTALL-206/invoker.properties
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals = clean install
diff --git a/src/it/MINSTALL-206/module-phase-none/pom.xml 
b/src/it/MINSTALL-206/module-phase-none/pom.xml
new file mode 100644
index 0000000..ce644a8
--- /dev/null
+++ b/src/it/MINSTALL-206/module-phase-none/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.install.minstall206</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0</version>
+  </parent>
+  <artifactId>module-phase-none</artifactId>
+  <packaging>jar</packaging>
+
+  <description>Module with no src directory and phase=none for the install 
plugin</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>default-install</id>
+            <phase>none</phase>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/MINSTALL-206/module-skip-true/pom.xml 
b/src/it/MINSTALL-206/module-skip-true/pom.xml
new file mode 100644
index 0000000..20159fe
--- /dev/null
+++ b/src/it/MINSTALL-206/module-skip-true/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.install.minstall206</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0</version>
+  </parent>
+  <artifactId>module-skip-true</artifactId>
+  <packaging>jar</packaging>
+
+  <description>Module with no src directory and skip=true for the install 
plugin</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/MINSTALL-206/pom.xml b/src/it/MINSTALL-206/pom.xml
new file mode 100644
index 0000000..eb5ed7b
--- /dev/null
+++ b/src/it/MINSTALL-206/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.install.minstall206</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+
+  <description>Test for MINSTALL-206: Ability to skip execution by setting 
phase to none</description>
+
+  <modules>
+    <module>module-phase-none</module>
+    <module>module-skip-true</module>
+  </modules>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/src/it/MINSTALL-206/verify.groovy 
b/src/it/MINSTALL-206/verify.groovy
new file mode 100644
index 0000000..57b8db5
--- /dev/null
+++ b/src/it/MINSTALL-206/verify.groovy
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+// Verify that both modules were built successfully
+File buildLog = new File(basedir, 'build.log')
+assert buildLog.exists()
+
+// Verify that the module with phase=none was skipped
+// We don't need to check for the install plugin output since it might not 
appear with phase=none
+assert !buildLog.text.contains("The packaging for this project did not assign 
a file to the build artifact")
+
+// Verify that the module with skip=true was skipped
+assert buildLog.text.contains("[INFO] Skipping artifact installation")
+
+// Verify that the parent POM was installed
+assert new File(localRepositoryPath, 
"org/apache/maven/its/install/minstall206/parent/1.0/parent-1.0.pom").exists()
+
+// Verify that neither of the modules were installed
+assert !new File(localRepositoryPath, 
"org/apache/maven/its/install/minstall206/module-phase-none/1.0/module-phase-none-1.0.jar").exists()
+assert !new File(localRepositoryPath, 
"org/apache/maven/its/install/minstall206/module-skip-true/1.0/module-skip-true-1.0.jar").exists()
+
+return true

Reply via email to