1

我正在使用程序集插件将小程序列表打包到带有我的 maven 项目的模块之一中的 zip 中。这是 pom.xml:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
     xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<artifactId>applets-deploy</artifactId>
<name>deploy</name>
<dependencies>
  <dependency>
    <groupId>com.activx.lims</groupId>
    <artifactId>applets-common</artifactId>
    <version>${project.version}</version>
  </dependency>
  <dependency>
    <groupId>com.activx.lims</groupId>
    <artifactId>ceplot-applet</artifactId>
    <version>${project.version}</version>
  </dependency>
  </dependencies>
......  
<build>
<plugins>
  <plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
      <descriptors>
        <descriptor>src/main/assembly/resources.xml</descriptor>
      </descriptors>
    </configuration>
    <executions>
      <execution>
        <id>make-assembly</id>
        <phase>package</phase>
        <goals>
          <goal>single</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
</plugins>
</build>
</project>

我需要在打包之前对 jar 进行签名,我可以在这里使用 jarsign 插件吗?如何使用?我在构建过程中找不到 jar 文件临时存储的位置。谢谢,

4

1 回答 1

0

这将是 jarsigner 插件的正常使用。默认情况下,jar 在打包阶段由 jar 插件构建并输出${project.build.directory}target.

您只需要在打包过程中构建 jar 之后和组装 zip 之前的某个时间对 jar 进行签名。您可以通过将程序集插件绑定到稍后的阶段或通过在程序集插件上方添加 jarsigner 插件并将其绑定到包阶段来做到这一点。

于 2012-04-25T04:58:03.053 回答