fix: Force inner ZIP to be included

This commit is contained in:
Teal Bauer 2025-04-08 10:34:06 +02:00
parent 8f3fa16ad8
commit c530976a6a
2 changed files with 15 additions and 43 deletions

36
pom.xml
View File

@ -18,6 +18,7 @@
<maven.install.skip>true</maven.install.skip> <maven.install.skip>true</maven.install.skip>
<maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format> <maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format>
<revision>dev</revision> <revision>dev</revision>
<inner.zip.filename>GhydraMCP-${git.commit.id.describe}-${maven.build.timestamp}.zip</inner.zip.filename>
</properties> </properties>
<dependencies> <dependencies>
@ -177,7 +178,7 @@
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version> <version>3.3.0</version>
<executions> <executions>
<!-- Execution for the Ghidra extension zip (runs first in package phase) --> <!-- Execution for the Ghidra extension zip -->
<execution> <execution>
<id>plugin-assembly</id> <id>plugin-assembly</id>
<phase>package</phase> <phase>package</phase>
@ -190,14 +191,13 @@
</descriptors> </descriptors>
<finalName>GhydraMCP-${git.commit.id.describe}-${maven.build.timestamp}</finalName> <finalName>GhydraMCP-${git.commit.id.describe}-${maven.build.timestamp}</finalName>
<appendAssemblyId>false</appendAssemblyId> <appendAssemblyId>false</appendAssemblyId>
<!-- Don't attach artifact -->
</configuration> </configuration>
</execution> </execution>
<!-- Execution for the complete package (runs second in package phase) --> <!-- Execution for the complete package -->
<execution> <execution>
<id>complete-package</id> <id>complete-package</id>
<phase>package</phase> <phase>verify</phase>
<goals> <goals>
<goal>single</goal> <goal>single</goal>
</goals> </goals>
@ -212,34 +212,6 @@
</executions> </executions>
</plugin> </plugin>
<!-- Copy the generated plugin zip to a staging area in the verify phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-plugin-zip</id>
<phase>verify</phase> <!-- Run after package phase -->
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/staging</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<includes>
<!-- Use properties here as they should be resolved by verify phase -->
<include>GhydraMCP-${git.commit.id.abbrev}-${maven.build.timestamp}.zip</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Copy dependencies and validate system paths --> <!-- Copy dependencies and validate system paths -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@ -19,17 +19,17 @@
<include>README.md</include> <include>README.md</include>
<include>LICENSE</include> <include>LICENSE</include>
</includes> </includes>
<outputDirectory></outputDirectory> <outputDirectory>/</outputDirectory>
</fileSet>
<!-- Include the Ghidra plugin zip copied by maven-resources-plugin -->
<fileSet>
<directory>${project.build.directory}/staging</directory> <!-- Point to staging directory -->
<includes>
<!-- Use exact pattern matching the staged file -->
<include>GhydraMCP-${git.commit.id.abbrev}-${maven.build.timestamp}.zip</include>
</includes>
<outputDirectory></outputDirectory>
</fileSet> </fileSet>
</fileSets> </fileSets>
<files>
<!-- Include the inner ZIP directly from target -->
<file>
<source>${project.build.directory}/${inner.zip.filename}</source>
<outputDirectory>/</outputDirectory>
<fileMode>0644</fileMode>
<destName>GhydraMCP-plugin.zip</destName>
</file>
</files>
</assembly> </assembly>