You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Thomas Bauer <pa...@xaidat.com> on 2003/02/09 01:11:40 UTC

jar building problem

Hi!

When I build a jar with ant's task "jar" it includes entries for the
directories (packages) in my jar. (like "mypackage/")
How could I avoid this?
So I only want *.class but no entries without "class" at the end.
regards

Thomas Bauer
-- 
Thomas Bauer <pa...@xaidat.com>


Re: jar building problem

Posted by Antoine Levy-Lambert <le...@tiscali-dsl.de>.
Thomas, may be you should enter your problem as a bug in the bugzilla
tracking system
nagoya.apache.org/bugzilla
----- Original Message -----
From: "Thomas Bauer" <pa...@xaidat.com>
To: "Martin" <we...@laconiadatasystems.com>
Cc: "ANT User Mailingliste" <an...@jakarta.apache.org>
Sent: Sunday, February 09, 2003 6:43 AM
Subject: Re: jar building problem


> Martin-
> Am Fre, 2002-08-16 um 04.12 schrieb Martin:
> > Thomas-
> >
> > The problem exists with the lack of documentation for specifying a
Directory
> > in excludes/includes
> > TRY THIS:
> > > When I run it with ant I use:
> > >     <jar jarfile="${dist}/${jarfilename}" manifest="${MF}/MANIFEST.MF"
> > > duplicate="preserve">
> > >       <fileset dir="${build}">
> > >         <includes="**/*.class"/>
> >            <excludes="/**/*.class"/>
> > >       </fileset>
> > >     </jar>
> >
> > die Zustimmung?
> > -Martin
> Well, your time is somehow broken (August 2002?) so I really don't know
> anymore if that's your last reply (maybe it is, because I'm coding since
> yesterday afternoon ;-)).
> I wrote you why I need a jar without directory-entries.
> I don't know exactly what you intend with the excludes, but the result
> is the same, I have directory-entries in the jar-file.
> But try it yourself:
> create a directory structure like this:
>
> mypackage/First.class
> mypackage/Second.class
>
> then try to build a jar with ant and on the commandline.
> when I run it on the commandline I get a jar: (jar tf myjar.jar)
> META-INF/
> META-INF/MANIFEST.MF
> mypackage/First.class
> mypackage/Second.class
>
> on the other hand when I run the ant task I get:
> META-INF/
> META-INF/MANIFEST.MF
> mypackage/
> mypackage/First.class
> mypackage/Second.class
>
> And this is not usable for WebStart (jnlp), because jarsigner does not
> sign the directory-entry "mypackage/"!
> best regards,
>
> Thomas
> --
> Thomas Bauer <pa...@xaidat.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
>


Re: jar building problem

Posted by Martin <mg...@hotmail.com>.
<jar ....
filesonly="yes"
-M

----- Original Message -----
From: "Thomas Bauer" <pa...@xaidat.com>
To: "Martin" <we...@laconiadatasystems.com>
Cc: "ANT User Mailingliste" <an...@jakarta.apache.org>
Sent: Sunday, February 09, 2003 1:43 AM
Subject: Re: jar building problem


> Martin-
> Am Fre, 2002-08-16 um 04.12 schrieb Martin:
> > Thomas-
> >
> > The problem exists with the lack of documentation for specifying a
Directory
> > in excludes/includes
> > TRY THIS:
> > > When I run it with ant I use:
> > >     <jar jarfile="${dist}/${jarfilename}" manifest="${MF}/MANIFEST.MF"
> > > duplicate="preserve">
> > >       <fileset dir="${build}">
> > >         <includes="**/*.class"/>
> >            <excludes="/**/*.class"/>
> > >       </fileset>
> > >     </jar>
> >
> > die Zustimmung?
> > -Martin
> Well, your time is somehow broken (August 2002?) so I really don't know
> anymore if that's your last reply (maybe it is, because I'm coding since
> yesterday afternoon ;-)).
> I wrote you why I need a jar without directory-entries.
> I don't know exactly what you intend with the excludes, but the result
> is the same, I have directory-entries in the jar-file.
> But try it yourself:
> create a directory structure like this:
>
> mypackage/First.class
> mypackage/Second.class
>
> then try to build a jar with ant and on the commandline.
> when I run it on the commandline I get a jar: (jar tf myjar.jar)
> META-INF/
> META-INF/MANIFEST.MF
> mypackage/First.class
> mypackage/Second.class
>
> on the other hand when I run the ant task I get:
> META-INF/
> META-INF/MANIFEST.MF
> mypackage/
> mypackage/First.class
> mypackage/Second.class
>
> And this is not usable for WebStart (jnlp), because jarsigner does not
> sign the directory-entry "mypackage/"!
> best regards,
>
> Thomas
> --
> Thomas Bauer <pa...@xaidat.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
>

Re: jar building problem

Posted by Thomas Bauer <pa...@xaidat.com>.
Martin-
Am Fre, 2002-08-16 um 04.12 schrieb Martin:
> Thomas-
> 
> The problem exists with the lack of documentation for specifying a Directory
> in excludes/includes
> TRY THIS:
> > When I run it with ant I use:
> >     <jar jarfile="${dist}/${jarfilename}" manifest="${MF}/MANIFEST.MF"
> > duplicate="preserve">
> >       <fileset dir="${build}">
> >         <includes="**/*.class"/>
>            <excludes="/**/*.class"/>
> >       </fileset>
> >     </jar>
> 
> die Zustimmung?
> -Martin
Well, your time is somehow broken (August 2002?) so I really don't know
anymore if that's your last reply (maybe it is, because I'm coding since
yesterday afternoon ;-)).
I wrote you why I need a jar without directory-entries.
I don't know exactly what you intend with the excludes, but the result
is the same, I have directory-entries in the jar-file.
But try it yourself:
create a directory structure like this:

mypackage/First.class
mypackage/Second.class

then try to build a jar with ant and on the commandline.
when I run it on the commandline I get a jar: (jar tf myjar.jar)
META-INF/
META-INF/MANIFEST.MF
mypackage/First.class
mypackage/Second.class

on the other hand when I run the ant task I get:
META-INF/
META-INF/MANIFEST.MF
mypackage/
mypackage/First.class
mypackage/Second.class

And this is not usable for WebStart (jnlp), because jarsigner does not
sign the directory-entry "mypackage/"!
best regards,

Thomas
-- 
Thomas Bauer <pa...@xaidat.com>


Re: jar building problem

Posted by Martin <mg...@hotmail.com>.
Thomas-

The problem exists with the lack of documentation for specifying a Directory
in excludes/includes
TRY THIS:
> When I run it with ant I use:
>     <jar jarfile="${dist}/${jarfilename}" manifest="${MF}/MANIFEST.MF"
> duplicate="preserve">
>       <fileset dir="${build}">
>         <includes="**/*.class"/>
           <excludes="/**/*.class"/>
>       </fileset>
>     </jar>

die Zustimmung?
-Martin

> >
> > ----- Original Message -----
> > From: "Thomas Bauer" <pa...@xaidat.com>
> > To: "Martin" <we...@laconiadatasystems.com>
> > Cc: "Ant Users List" <an...@jakarta.apache.org>
> > Sent: Saturday, February 08, 2003 8:36 PM
> > Subject: Re: jar building problem
> >
> >
> > > Am Don, 2002-08-15 um 23.14 schrieb Martin:
> > > > Thomas-
> > > >
> > > > Assuming dist is set to distribution directory and build property is
set
> > to
> > > > the build directory
> > > >
> > > > jars all files in the ${build}/classes directory into a file called
> > app.jar
> > > > in the ${dist}/lib directory. Files with the name *.class are
included.
> > > > files with name mypackage are excluded
> > > >
> > > >   <jar destfile="${dist}/lib/app.jar"
> > > >        basedir="${build}/classes"
> > > >        includes="**/*.class"       excludes="mypackage"
> > > >   />Ok?
> > >
> > > No, I want the class files in mypackage too, but I just don't want an
> > > entry "mypackage" in my jar archive.
> > > e.g.:
> > > contents of jar:
> > > Top.class
> > > Top2.class
> > > mypackage/Sub.class
> > > mypackage/OtherSub.class
> > >
> > > when I build it with ant I get:
> > > Top.class
> > > Top2.class
> > > mypackage/
> > > mypackage/Sub.class
> > > mypackage/OtherSub.class
> > >
> > > And I need the first sample - without the "mypackage/".
> > > regards,
> > >
> > > Thomas
> > >
> > > > -M----- Original Message -----
> > > > From: "Thomas Bauer" <pa...@xaidat.com>
> > > > To: "ANT User Mailingliste" <an...@jakarta.apache.org>
> > > > Sent: Saturday, February 08, 2003 8:11 PM
> > > > Subject: jar building problem
> > > >
> > > >
> > > > > Hi!
> > > > >
> > > > > When I build a jar with ant's task "jar" it includes entries for
the
> > > > > directories (packages) in my jar. (like "mypackage/")
> > > > > How could I avoid this?
> > > > > So I only want *.class but no entries without "class" at the end.
> > > > > regards
> > > > >
> > > > > Thomas Bauer
> > > > > --
> > > > > Thomas Bauer <pa...@xaidat.com>
> > > > >
> > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> > > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> > > --
> > > Thomas Bauer <pa...@xaidat.com>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> --
> Thomas Bauer <pa...@xaidat.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
>

Re: jar building problem

Posted by Thomas Bauer <pa...@xaidat.com>.
Hi Martin!

Am Fre, 2002-08-16 um 00.30 schrieb Martin:
> Thomas-
> 
[snip]
> see http://ant.apache.org/manual/index.html
Reading the last days over and over again :)

> 
> Could I ask the question why you want to jar in a package for which the
> manifest has no location?
Sorry that I confused u with not telling u why I need this.

My application launcher (jnlp) verifies a signed jar file if all files
in it are signed. If one file is not signed, it rejects the jar file.
If I want to have "all-permissions" security level on the client side, I
need a signed jar-file.
When I sign a jarfile using jarsigner, only the *.class files in the jar
file get signed.
When I verify a signed jar file using "jarsigner -verify -verbose" I see
a "signed" flag only for the *.class files.
So I need a jar without "directory-only" entries then signing it will
work.
I tried it on the command-line (Linux) with "jar cfm myjar.jar
mymanifest.mf **/*.class" and it works and it includes only the class
files.
When I run it with ant I use:
    <jar jarfile="${dist}/${jarfilename}" manifest="${MF}/MANIFEST.MF"
duplicate="preserve">
      <fileset dir="${build}">
        <include name="**/*.class"/>
      </fileset>
    </jar>

And it includes the directories.
The only solution to this problem is executing jar using the ant task
"exec" but I don't want this, because it wouldn't be platform
independant.
That's my problem ;-)
regards,

Thomas
> 
> Regards,
> 
> -Martin
> 
> ----- Original Message -----
> From: "Thomas Bauer" <pa...@xaidat.com>
> To: "Martin" <we...@laconiadatasystems.com>
> Cc: "Ant Users List" <an...@jakarta.apache.org>
> Sent: Saturday, February 08, 2003 8:36 PM
> Subject: Re: jar building problem
> 
> 
> > Am Don, 2002-08-15 um 23.14 schrieb Martin:
> > > Thomas-
> > >
> > > Assuming dist is set to distribution directory and build property is set
> to
> > > the build directory
> > >
> > > jars all files in the ${build}/classes directory into a file called
> app.jar
> > > in the ${dist}/lib directory. Files with the name *.class are included.
> > > files with name mypackage are excluded
> > >
> > >   <jar destfile="${dist}/lib/app.jar"
> > >        basedir="${build}/classes"
> > >        includes="**/*.class"       excludes="mypackage"
> > >   />Ok?
> >
> > No, I want the class files in mypackage too, but I just don't want an
> > entry "mypackage" in my jar archive.
> > e.g.:
> > contents of jar:
> > Top.class
> > Top2.class
> > mypackage/Sub.class
> > mypackage/OtherSub.class
> >
> > when I build it with ant I get:
> > Top.class
> > Top2.class
> > mypackage/
> > mypackage/Sub.class
> > mypackage/OtherSub.class
> >
> > And I need the first sample - without the "mypackage/".
> > regards,
> >
> > Thomas
> >
> > > -M----- Original Message -----
> > > From: "Thomas Bauer" <pa...@xaidat.com>
> > > To: "ANT User Mailingliste" <an...@jakarta.apache.org>
> > > Sent: Saturday, February 08, 2003 8:11 PM
> > > Subject: jar building problem
> > >
> > >
> > > > Hi!
> > > >
> > > > When I build a jar with ant's task "jar" it includes entries for the
> > > > directories (packages) in my jar. (like "mypackage/")
> > > > How could I avoid this?
> > > > So I only want *.class but no entries without "class" at the end.
> > > > regards
> > > >
> > > > Thomas Bauer
> > > > --
> > > > Thomas Bauer <pa...@xaidat.com>
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> > --
> > Thomas Bauer <pa...@xaidat.com>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
-- 
Thomas Bauer <pa...@xaidat.com>


Re: jar building problem

Posted by Martin <mg...@hotmail.com>.
Thomas-

Looks like you'll have to build a manifest see <manifest> specifically
omitting the section for ''mypackage"
see http://ant.apache.org/manual/index.html (output manifest will be
META-INF/MANIFEST.MF)

later on jar including the manifest file you've just created in
META-INF/MANIFEST.MF
and specifying includes for the package you desire to include
(includes="mypackage/**")
see http://ant.apache.org/manual/index.html

Could I ask the question why you want to jar in a package for which the
manifest has no location?

Regards,

-Martin

----- Original Message -----
From: "Thomas Bauer" <pa...@xaidat.com>
To: "Martin" <we...@laconiadatasystems.com>
Cc: "Ant Users List" <an...@jakarta.apache.org>
Sent: Saturday, February 08, 2003 8:36 PM
Subject: Re: jar building problem


> Am Don, 2002-08-15 um 23.14 schrieb Martin:
> > Thomas-
> >
> > Assuming dist is set to distribution directory and build property is set
to
> > the build directory
> >
> > jars all files in the ${build}/classes directory into a file called
app.jar
> > in the ${dist}/lib directory. Files with the name *.class are included.
> > files with name mypackage are excluded
> >
> >   <jar destfile="${dist}/lib/app.jar"
> >        basedir="${build}/classes"
> >        includes="**/*.class"       excludes="mypackage"
> >   />Ok?
>
> No, I want the class files in mypackage too, but I just don't want an
> entry "mypackage" in my jar archive.
> e.g.:
> contents of jar:
> Top.class
> Top2.class
> mypackage/Sub.class
> mypackage/OtherSub.class
>
> when I build it with ant I get:
> Top.class
> Top2.class
> mypackage/
> mypackage/Sub.class
> mypackage/OtherSub.class
>
> And I need the first sample - without the "mypackage/".
> regards,
>
> Thomas
>
> > -M----- Original Message -----
> > From: "Thomas Bauer" <pa...@xaidat.com>
> > To: "ANT User Mailingliste" <an...@jakarta.apache.org>
> > Sent: Saturday, February 08, 2003 8:11 PM
> > Subject: jar building problem
> >
> >
> > > Hi!
> > >
> > > When I build a jar with ant's task "jar" it includes entries for the
> > > directories (packages) in my jar. (like "mypackage/")
> > > How could I avoid this?
> > > So I only want *.class but no entries without "class" at the end.
> > > regards
> > >
> > > Thomas Bauer
> > > --
> > > Thomas Bauer <pa...@xaidat.com>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> --
> Thomas Bauer <pa...@xaidat.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
>

Re: jar building problem

Posted by Thomas Bauer <pa...@xaidat.com>.
Am Don, 2002-08-15 um 23.14 schrieb Martin:
> Thomas-
> 
> Assuming dist is set to distribution directory and build property is set to
> the build directory
> 
> jars all files in the ${build}/classes directory into a file called app.jar
> in the ${dist}/lib directory. Files with the name *.class are included.
> files with name mypackage are excluded
> 
>   <jar destfile="${dist}/lib/app.jar"
>        basedir="${build}/classes"
>        includes="**/*.class"       excludes="mypackage"
>   />Ok?

No, I want the class files in mypackage too, but I just don't want an
entry "mypackage" in my jar archive.
e.g.:
contents of jar:
Top.class
Top2.class
mypackage/Sub.class
mypackage/OtherSub.class

when I build it with ant I get:
Top.class
Top2.class
mypackage/
mypackage/Sub.class
mypackage/OtherSub.class

And I need the first sample - without the "mypackage/".
regards,

Thomas

> -M----- Original Message -----
> From: "Thomas Bauer" <pa...@xaidat.com>
> To: "ANT User Mailingliste" <an...@jakarta.apache.org>
> Sent: Saturday, February 08, 2003 8:11 PM
> Subject: jar building problem
> 
> 
> > Hi!
> >
> > When I build a jar with ant's task "jar" it includes entries for the
> > directories (packages) in my jar. (like "mypackage/")
> > How could I avoid this?
> > So I only want *.class but no entries without "class" at the end.
> > regards
> >
> > Thomas Bauer
> > --
> > Thomas Bauer <pa...@xaidat.com>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: ant-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
-- 
Thomas Bauer <pa...@xaidat.com>


Re: jar building problem

Posted by Martin <mg...@hotmail.com>.
Thomas-

Assuming dist is set to distribution directory and build property is set to
the build directory

jars all files in the ${build}/classes directory into a file called app.jar
in the ${dist}/lib directory. Files with the name *.class are included.
files with name mypackage are excluded

  <jar destfile="${dist}/lib/app.jar"
       basedir="${build}/classes"
       includes="**/*.class"       excludes="mypackage"
  />Ok?-M----- Original Message -----
From: "Thomas Bauer" <pa...@xaidat.com>
To: "ANT User Mailingliste" <an...@jakarta.apache.org>
Sent: Saturday, February 08, 2003 8:11 PM
Subject: jar building problem


> Hi!
>
> When I build a jar with ant's task "jar" it includes entries for the
> directories (packages) in my jar. (like "mypackage/")
> How could I avoid this?
> So I only want *.class but no entries without "class" at the end.
> regards
>
> Thomas Bauer
> --
> Thomas Bauer <pa...@xaidat.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-user-help@jakarta.apache.org
>