ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniele Development-ML" <daniele....@googlemail.com>
Subject Re: Using Ant Tasks programmatically - SignJar Tasl
Date Thu, 06 Nov 2008 10:20:53 GMT
Thanks.
I tried your suggestions, and the problem concerned that seems to be solved
- thanks!

Now, I get another exception, which seems somehow related to ant libraries -
this is my understanding. I have included all the ant jars in my
application. I post the exception and the new code - hoping in other
suggestions.

Thanks!

Dan

The new code is:

        Project project = new Project();
        Target target = new Target();
        SignJar sj = new SignJar();
        target.addTask(sj);

        project.addTarget("sign_jar", target);

        sj.setAlias("myDep");
        sj.setStorepass("myPrj");
        sj.setProject(project);

        sj.setJar(new File(fileName));
        sj.setSigfile(sigFile);

        project.executeTarget("sign_jar");

Exception:

Exception in thread "main" jarsigner returned: 1
        at
org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
        at
org.apache.tools.ant.taskdefs.SignJar.signOneJar(SignJar.java:407)
        at org.apache.tools.ant.taskdefs.SignJar.execute(SignJar.java:336)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)




On Wed, Nov 5, 2008 at 9:10 PM, Mark Salter <marksalter@talktalk.net> wrote:

> Morgan Kinne wrote:
> > try sj.perform()
> >
> It looks to me like you will still need to set a sj.setProject(project).
>
> I can't find anything that states this requirement, sorry.
>
> --
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message