Ignore SVN files when exporting a WAR file from Eclipse?

跟風遠走 提交于 2019-11-28 10:58:31
Talles

Enter the project properties > Resource > Resource Filters > Add... > Exclude All > Files and Folders > All children (recursive) > Name matches *.svn > OK.

All .svn files and folders will be ignored, including when you export WAR files.

This seems to be documented in bug 182534 (2007! And still opened).

A custom separate ant script would be needed for now in order to build the exact war.
The internal "Export War" eclipse feature is not yet good enough for this scenario.

user342394

Installing the Subclipse plugin will make Eclipse aware of the SVN folders. This also includes ignoring them in a WAR export.

You could use an svn client to do the trick. For example TortoiseSVN let you export a directory without .svn folders and files.

So what you could do is:

  1. Export you war
  2. Unzip it (a war is a zip file with changed extension)
  3. Tortoise-export the directory (remember to check "Include unversioned files" cause your .class will probably be unversioned)
  4. Zip the new directory and rename it to .war

This is not a good workaround but it saves you from checking every subfolder in your war to see if some .svn has not been removed.

While exporting the project just uncheck the unneeded folder like ".svn" in the Project Export wizard like this

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!