• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Ant - How to get needed class files from xerces.jar to myOwn.jar?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have finally figured out how to make property entries and target entries. I can compile myOwn.java files and use thirdParty.jar libraries. How do I get the needed class files from the thirdParty.jars into myOwn.jar for deployment? I used the following(left out the property aspects):
<target name="deployMyApp" depends="compileMyApp" >
<jar jarfile="d:\MyApp\MyApp.jar" >
<!-- following does put my classes into jar -->
<fileset dir="d:\MyApp\classes" >
<include name="**\*.class" />
</fileset>
<!-- following does not work -->
<fileset dir="d:\MyAppProject\lib" >
<include name="**\*.jar" />
</fileset>
</jar>
</target>
Thanks for your help.
P.S. Thomas Paul, Wish I had seen your March Java Ranch Newsletter Ant article a whole lot sooner. Oh well.
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you want to distribute the xerces JAR file(s) with your application? I've never pulled classes from a third-party JAR file to include them in my own JAR file.
Curious,
Craig
 
Irene Fernandez
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good question...
Your question made me notice I was asking for one thing but trying to do another. There is a wee bit of history: we have a directory structure which is used in our version control tool and in our IDE. This is not the same as our package structure. We use the IDE to deploy the jar files. This deployment is NOT including the xerces.jar but instead is including only the "needed" class files. That was the source of my word phrasing.
In the build.xml, I am trying to get the xerces.jar into the myApp.jar but that jar was not getting put in. Today, with a fresh look, I see it is a problem with the way I was stating the "include name=". I was directing ant to look through directories for the *.jar but the reality was that there are no subdirectories. So the statement is syntatically correct but is NOT appropriate for the actual situation.
My original would work if the directory structure were:
d:\MyAppProject\lib\subOne\xerces.jar
<jar jarfile="d:\MyApp\MyApp.jar" >
<fileset dir="d:\MyApp\classes" >
<include name="**\*.class" />
</fileset>
<fileset dir="d:\MyAppProject\lib" >
<include name="**\*.jar" />
</fileset>
</jar>
The following works for my actual situation:
d:\MyAppProject\lib\xerces.jar
<jar jarfile="d:\MyApp\MyApp.jar" >
<fileset dir="d:\MyApp\classes" >
<include name="**\*.class" />
</fileset>
<fileset dir="d:\MyAppProject\lib" >
<include name="*.jar" />
</fileset>
</jar>

Irene

 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Craig Demyanovich:
Why don't you want to distribute the xerces JAR file(s) with your application? I've never pulled classes from a third-party JAR file to include them in my own JAR file.
Curious,
Craig


Agree with you whole heartly, this is not only a tech-issue, but also a moral issue too.
[ June 20, 2002: Message edited by: Roseanne Zhang ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic