Hi

I am trying to sign a jar, but build fails.
The funny thing is that if I copy the same command from maven trace and
execute it over the command line, it works OK.
I hope someone could lend me a hand, thanks!

Dan

Here goes the info.

So, this command executes OK:
D:\WORKSPACES\USERS_ALERTS\users>"C:\Program
Files\Java\j2sdk1.4.2_15\jre\..\bin
\jarsigner.exe" -keystore "C:\Documents and Settings\danmayolo/.keystore"
-storep
ass password1 -keypass password1
D:\WORKSPACES\USERS_ALERTS\users\target\users-1
.0.2-20080511.jar mykey
------
This is my POM:
<?xml version="1.0" encoding="UTF-8"?>
<project>
    <parent>
        <artifactId>maven</artifactId>
        <groupId>net.excelsystems</groupId>
        <version>1.0</version>
        <relativePath>../maven</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>net.excelsystems.framework</groupId>
    <artifactId>users</artifactId>
    <version>1.0.2-20080511</version>
    <name>Excelsystems Users</name>
    <description>User administration module</description>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Vendor>
                                Excelsystems.net
                            </Implementation-Vendor>
                            <Specification-Version>
                                ${pom.version}
                            </Specification-Version>
                        </manifestEntries>
                    </archive>
                    <keystore>${user.home}/.keystore</keystore>
                    <alias>mykey</alias>
                    <storepass>password1</storepass>
                    <keypass>password1</keypass>
                    <verify>true</verify>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src</directory>
                <includes>
                    <include>xml/module-config.xml</include>
                    <include>**/*.hbm.xml</include>
                </includes>
            </resource>
        </resources>
    </build>
    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>1.2.8</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>3.2.6ga</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>ehcache</artifactId>
                    <groupId>ehcache</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.excelsystems.framework</groupId>
            <artifactId>commons</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>net.excelsystems.framework</groupId>
            <artifactId>parameters</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</project>

------
This is Error stack trace:

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
-------------------------------------------------------------------------
---
[INFO] Building Excelsystems Users
[INFO]    task-segment: [package]
[INFO]
-------------------------------------------------------------------------
---
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 52 source files to
D:\WORKSPACES\USERS_ALERTS\users\target\clas
ses
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar:
D:\WORKSPACES\USERS_ALERTS\users\target\users-1.0.2-2008051
1.jar
[INFO] [jar:sign {execution: default}]
[debug] jarsigner executable=[C:\Program
Files\Java\j2sdk1.4.2_15\jre\..\bin\jar
signer.exe]
[debug] Executing: "C:\Program
Files\Java\j2sdk1.4.2_15\jre\..\bin\jarsigner.exe
" -verify D:\WORKSPACES\USERS_ALERTS\users\target\users-1.0.2-20080511.jar
[info] jar is unsigned. (signatures missing or not parsable)
[WARNING] 'C:\Program' is not recognized as an internal or external command,
[WARNING] operable program or batch file.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Result of "C:\Program
Files\Java\j2sdk1.4.2_15\jre\..\bin\jarsigner.exe"
-keystore "C:\Documents and Settings\danmayolo/.keystore" -storepass ******
-keyp
ass ****** D:\WORKSPACES\USERS_ALERTS\users\target\users-1.0.2-20080511.jar
myke
y execution is: '1'.
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Result of
"C:\Program Fi
les\Java\j2sdk1.4.2_15\jre\..\bin\jarsigner.exe" -keystore "C:\Documents and
Set
tings\danmayolo/.keystore" -storepass ****** -keypass ******
D:\WORKSPACES\USERS_
ALERTS\users\target\users-1.0.2-20080511.jar mykey execution is: '1'.
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:564)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Result of
"C:\Program
 Files\Java\j2sdk1.4.2_15\jre\..\bin\jarsigner.exe" -keystore "C:\Documents
and
Settings\danmayolo/.keystore" -storepass ****** -keypass ******
D:\WORKSPACES\USE
RS_ALERTS\users\target\users-1.0.2-20080511.jar mykey execution is: '1'.
        at
org.apache.maven.plugin.jar.JarSignMojo.signJar(JarSignMojo.java:331)

        at
org.apache.maven.plugin.jar.JarSignMojo.execute(JarSignMojo.java:228)

        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
        ... 16 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Tue May 13 10:38:40 CLT 2008
[INFO] Final Memory: 5M/12M
[INFO]
------------------------------------------------------------------------


This is maven version output:
Maven version: 2.0.7
Java version: 1.4.2_15
OS name: "windows xp" version: "5.1" arch: "x86"

Reply via email to