简体   繁体   中英

Eclipse: Export Runnable Jar file should include specific files

I am trying to export a jar file via this command: Export -> Runnable JAR file -> Copy required libraries into a sub-folder next to the generated JAR.

I was trying to minimize the size of my JAR file and I want to exclude the xtend files since this has already been converted to java. The build.properties in my plugin.xml contains this:

source.. = src/,\
          src-gen/,\
          xtend-gen/
bin.includes = META-INF/,\
               .,\
               plugin.xml
src.excludes = **/*.xtend
bin.excludes = **/*.xtend
exclude.. = **/*.xtend

The problem is, the xtend files still get added into the JAR file. How can I exclude specific files from being added into the JAR file?

Update: I ticked the "Save as ANT script" option. I have modified the ANT script to exclude those files I do not want.

<fileset dir="D:/xtext/bin">
    <exclude name="**/*.xtend" />
</fileset>

But everytime I generate the JAR file, it just overwrites the script. How can I generate the JAR file using the modified ANT script?

when you do the export you have the option to store the export process as an ant file. in this ant file you can find a section that adds the bin folder to file files. there you could exclude the xtend files.

the build.properties only counts for osgi/plugin export - the runnable jar file wizard does not know it.

When you first export your Runnable Jar, check the "Save as ANT script" option. Then edit the script to exculde the files you don't want. Right click on the script -> Run As -> Ant Build

That's it!

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