Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Exclude some files from Eclipse Java EE Web Application project Deployment Assembly

Tags:

eclipse

war

As described into question title, I've an Eclipse Java EE Web Application project. Into WebContent folder I've some files and subfolder in which there are .DS_store OsX system files that cause some problem because they are always included when I export into war file.

I know that there is a way for excluding a file or folder but only into src folder, not into WebContent!

Any ideas?

Regards

like image 913
michael Avatar asked Jan 27 '16 08:01

michael


2 Answers

Why not remove the from (delete or just move to another folder) if they shouldnt be in your webcontent folder?

Otherwise you could use the Deployment Assembly settings. Open it from your project properties, and remove the top WebContent and add what you really want to get packaged.

enter image description here

Also you can exclude the files/folder by setting a resource filter. Add a filter... as shown below: enter image description here

like image 51
MrSimpleMind Avatar answered Nov 18 '22 22:11

MrSimpleMind


you can use war task of ant. say you located your ant build file directly inside your web-project then the following work for you which excludes folder .DS_store and all its contents from exported war file.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="war" name="TestWeb">
    <target description="export-war" name="war">
        <war destfile="/home/guest/Desktop/TestWeb1.war" webxml="WebContent/WEB-INF/web.xml">
            <fileset dir="WebContent">
                <exclude name="**/.DS_store/**"/>
            </fileset>
            <classes dir="build" />
        </war>
    </target>
</project>
like image 21
guleryuz Avatar answered Nov 18 '22 23:11

guleryuz