1

I'm using assembly plugin to package a list of applets into zip in one of modules with my maven project. here is the 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>

what I need is to also sign jars before they are packaged, can I use jarsign plugin here, and how? I can't find where the jar files are temporarily stored during the build process. Thanks,

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
David Zhao
  • 4,284
  • 11
  • 46
  • 60

1 Answers1

0

This would be a pretty normal use of the jarsigner plugin. By default, jars are built by the jar plugin during the package phase and output to the ${project.build.directory}, which defaults to target.

You'd just need to sign the jars some time after they're built during package and before you assemble the zip. You could do that by binding the assembly plugin to a later phase or by adding the jarsigner plugin above the assembly plugin and binding it to the package phase, too.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199
  • but I need to specify "archiveDirectory" in jarsigner plugin, but I don't seem to be able to find the intermediate working directory created with all the jars need to be signed, which later on to be zipped. – David Zhao Apr 27 '12 at 18:07
  • Have you tried the [jarsigner plugin's first usage example](http://maven.apache.org/plugins/maven-jarsigner-plugin/usage.html)? It shows exactly how to do what you seem to be asking for as far as the jar signing. After that, it's just a matter of making sure the assembly plugin is picking up the signed jars. – Ryan Stewart Apr 27 '12 at 18:17