ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Kinne <kin...@us.ibm.com>
Subject Re: Using Ant Tasks programmatically - SignJar Tasl
Date Wed, 05 Nov 2008 20:03:52 GMT
try sj.perform()



From:
"Daniele Development-ML" <daniele.dml@googlemail.com>
To:
"Ant Users List" <user@ant.apache.org>
Date:
11/05/2008 12:17 PM
Subject:
Using Ant Tasks programmatically - SignJar Tasl



Hello everybody:
I am trying to use Ant Task programmatically by invoking the API within my
Java code.

I get an exception, but everything appears to be fine to my eyes - I 
indeed
set all the compulsory attributes of the SignJar task. Probably somebody
else here has a good suggestion or the solution.

Thanks in advance!

Dan

----------------------------
My code is:

        String sigFile = Paths.SIG_FILE_PATH;

        SignJar sj = new SignJar();

        sj.setAlias("myDep");
        sj.setStorepass("aPassword");

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

        sj.execute();

The exception I get is:

Exception in thread "main" java.lang.NullPointerException
        at
org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:477)
        at
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:442)
        at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
        at
org.apache.tools.ant.types.resources.Union.getCollection(Union.java:110)
        at
org.apache.tools.ant.types.resources.Union.getCollection(Union.java:90)
        at
org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.cacheCollection(BaseResourceCollectionContainer.java:250)
        at
org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.iterator(BaseResourceCollectionContainer.java:126)
        at org.apache.tools.ant.types.Path.iterator(Path.java:693)
        at org.apache.tools.ant.taskdefs.SignJar.execute(SignJar.java:321)



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