This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch maven-install-plugin-4.x
in repository https://gitbox.apache.org/repos/asf/maven-install-plugin.git
The following commit(s) were added to refs/heads/maven-install-plugin-4.x by
this push:
new 3af47d6 Add the pom-packaged project IT to 4.x
3af47d6 is described below
commit 3af47d65c3d72047993e0aec0b717aac6c8ec00f
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sat Nov 21 18:15:00 2026 +0100
Add the pom-packaged project IT to 4.x
Same IT and verify script as on master. On Maven 4 it also checks the
-build.pom, which a missing setPath on the POM artifact would fill with the
JAR.
---
.../invoker.properties | 18 +++++++++
src/it/pom-packaged-project-installs-pom/pom.xml | 46 ++++++++++++++++++++++
.../pom-packaged-project-installs-pom/setup.groovy | 24 +++++++++++
.../verify.groovy | 35 ++++++++++++++++
4 files changed, 123 insertions(+)
diff --git a/src/it/pom-packaged-project-installs-pom/invoker.properties
b/src/it/pom-packaged-project-installs-pom/invoker.properties
new file mode 100644
index 0000000..cf6fed7
--- /dev/null
+++ b/src/it/pom-packaged-project-installs-pom/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 = jar:jar install:install
diff --git a/src/it/pom-packaged-project-installs-pom/pom.xml
b/src/it/pom-packaged-project-installs-pom/pom.xml
new file mode 100644
index 0000000..ac88dea
--- /dev/null
+++ b/src/it/pom-packaged-project-installs-pom/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.minstall315</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <description>MINSTALL-315: Verifies that install:install on a pom-packaged
project installs the POM, not any
+ JAR produced by a preceding jar:jar invocation.</description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>@version.maven-jar-plugin@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>@project.version@</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/src/it/pom-packaged-project-installs-pom/setup.groovy
b/src/it/pom-packaged-project-installs-pom/setup.groovy
new file mode 100644
index 0000000..c5d81de
--- /dev/null
+++ b/src/it/pom-packaged-project-installs-pom/setup.groovy
@@ -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.
+ */
+
+File dir = new File( localRepositoryPath,
"org/apache/maven/its/install/minstall315" )
+System.out.println( "Deleting " + dir )
+dir.deleteDir()
+
+return true
diff --git a/src/it/pom-packaged-project-installs-pom/verify.groovy
b/src/it/pom-packaged-project-installs-pom/verify.groovy
new file mode 100644
index 0000000..f44bcef
--- /dev/null
+++ b/src/it/pom-packaged-project-installs-pom/verify.groovy
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+// jar:jar on a pom-packaged project sets project.getArtifact().getFile() to
the produced JAR.
+// A subsequent install:install must install the POM, not that JAR. Maven 4
also installs a
+// -build.pom next to the consumer POM, so check every installed .pom file.
+
+File dir = new File( localRepositoryPath,
"org/apache/maven/its/install/minstall315/test/1.0" )
+File installed = new File( dir, "test-1.0.pom" )
+assert installed.isFile() : "Installed file not found: " + installed
+
+// A JAR (ZIP) starts with the magic bytes PK (0x50 0x4B).
+for ( File pom : dir.listFiles().findAll { it.name.endsWith( ".pom" ) } )
+{
+ byte[] magic = new byte[2]
+ pom.withInputStream { it.read( magic ) }
+ assert !( magic[0] == 0x50 && magic[1] == 0x4B ) :
+ "install:install installed a JAR (ZIP) instead of the POM as " +
pom.name
+}