This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes creating jar for specific files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "creating jar for specific files" Watch "creating jar for specific files" New topic
Author

creating jar for specific files

Eshwin Sukhdeve
Ranch Hand

Joined: Mar 15, 2012
Posts: 80
Hi,
I have one lib folder in this folder it contains java files are there.i need to create the jar file for this java classes.this folder
contains one java file.I dont want to make that class as a part of jar file.

<target name="mainjar" depends="compile">
<jar destfile="ProjectSonnetTest\src\mainProject.jar"
basedir="ProjectSonnetTest\src\src\lib" excludes="ProjectSonnetTest\src\lib\TestExecute.java">
</jar>
</target>
here I am dont want to make TestExecute.java as a part fo jar file.
I am using this code.but it is creating the jar file for all java classes which is inside the src folder.

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Try using this instead:

excludes="**/*.java"

or even this:

excludes="**/TestExecute.java"


Also, never use back-slashes (\) in ant scripts - they are too often interpreted as as escape characters.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating jar for specific files
 
Similar Threads
creating subfolders in eclipse using ANT
Difference in JAR file size
urgent help please (creating jar file using ant)
Ant Build Failing -- Need a way to pick jar file during run time.
How to Hot deploy in weblogic8.1