简体   繁体   中英

Eclipse: Excluding some libraries while extracting others on export to Runnable JAR

I'm building a java project that implements Twitter Storm, and I want to extract and package in my custom libraries into the .jar file. However, if I extract all the required libraries (using the Extract required libraries into generated JAR , the .jar ends up being 20mB in size, as opposed to around 200kBs (using the Copy required libraries into a sub-folder next to the generated JAR option).

Is there any way I can specify which libraries I want to be packaged in? Ideally, I'd be able to select these to be extracted into the .jar file, while the rest are excluded. I can't seem to find an option in Eclipse to do this.

Thanks very much

I think your best bet is to use the option to "Save as Ant script" and then edit the build.xml to remove the jar files that you don't want to have included in.

Dealing with build.xml files in Eclipse is very easy/natural. If you do show view/Ant, and then drag the build.xml from the package explorer to the ant view, you can just double click on it. Much easier than going through the export dialog e very time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM