This is an automated email from the ASF dual-hosted git repository.
slachiewicz 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 a1104c4 Check every installed POM in the pom-packaged project IT
a1104c4 is described below
commit a1104c4ba0f8597f3270e197a59e05967a78f9df
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sat Nov 21 18:14:57 2026 +0100
Check every installed POM in the pom-packaged project IT
Maven 4 installs a -build.pom next to the consumer POM, and the JAR can end
up
there; the script now checks both and uses a for loop, since invoker fails a
script that returns a list.
---
.../verify.groovy | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/it/pom-packaged-project-installs-pom/verify.groovy
b/src/it/pom-packaged-project-installs-pom/verify.groovy
index 6e9cc25..f44bcef 100644
--- a/src/it/pom-packaged-project-installs-pom/verify.groovy
+++ b/src/it/pom-packaged-project-installs-pom/verify.groovy
@@ -18,18 +18,18 @@
*/
// 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.
-
-File installed = new File( localRepositoryPath,
- "org/apache/maven/its/install/minstall315/test/1.0/test-1.0.pom" )
+// 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
-// The installed file must not be a JAR (ZIP). Check the magic bytes:
PK\x03\x04 = 0x50 0x4B 0x03 0x04.
-byte[] magic = new byte[4]
-new FileInputStream( installed ).with { stream ->
- stream.read( magic )
+// 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
}
-
-assert !( magic[0] == 0x50 && magic[1] == 0x4B ) :
- "install:install installed a JAR (ZIP) instead of the POM for a
pom-packaged project"