【发布时间】:2009-11-17 23:46:46
【问题描述】:
我有一个 Maven 项目,它是一个子项目。它有许多同级项目,这个项目的工作是从同级项目中获取资源并使用 antrun 插件将它们打包成一个 zip 文件。
<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/maven-v4_0_0.xsd">
<parent>
<artifactId>SystemOfRegistries</artifactId>
<groupId>someGroup</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>someGroup</groupId>
<artifactId>deploy-data</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<!--
Place any Ant task here. You can add anything you can add
between <target> and </target> in a build.xml.
-->
<zip destfile="${project.build.directory}/${build.finalName}.zip"
whenempty="fail">
<zipfileset dir="${project.parent.basedir}/build/AG" prefix="ag"/>
</zip>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
这对于构建 zip 非常有效。但是,问题在于 zip 不是构建的工件。而且,因此在 Hudson 中没有下载链接。
我想弄清楚如何让 Hudson 将其识别为 Maven 的工件,或者让 Maven 意识到 ZIP 是工件。 (我曾经缺少包装元素,然后我会得到一个不需要的 JAR 作为工件)。
【问题讨论】:
标签: maven-2 ant hudson maven-plugin