• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant Script for removing java files from a jar.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i user ANT Script to compile a struts application. I user the same ANT script for building the EAR and deploying . Now my main problem is i user application specific jars in my EAR. These Application Specific jars contain both the java files and the class files. Now i think there will be ANT code for removing the java files from the jar file before building the EAR only. Please help me with the need ful.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Srikanth,
Welcome to JavaRanch!

Can you post the task that creates the jar? This will someone point you to where to exclude the Java files.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by srikanth venkata:
Hi i user ANT Script to compile a struts application. I user the same ANT script for building the EAR and deploying . Now my main problem is i user application specific jars in my EAR. These Application Specific jars contain both the java files and the class files. Now i think there will be ANT code for removing the java files from the jar file before building the EAR only. Please help me with the need ful.



Hello Srikanth,

Where you have written a code to create a jar file, there you have to write a statement to exclude java files.



In the above code, I am assuming that this build file includes two properties ${nameOfJar} for specifying the name of the distributable jar plus ${pathOfSourceFiles} for specifying the path of the source(.java) files
and this target has dependency on target 'compile-source' which will compile the java files.

**/*.java ensures that the java files in subdirectories are also excluded.

For more options of jar task Click here
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic