Exclude Ivy Dependencies in WAR File

断了今生、忘了曾经 提交于 2019-12-13 01:27:01

问题


I use Eclipse and the Ivy plugin IvyDE.

I currently create a WAR file by using Eclipse's export to WAR functionality. I don't use an ANT build file - I let Eclipse handle that.

When I export to war, all the dependencies in the ivy.xml file get copied to the war file's bin directory. I want to exclude one (or more) of them. How do I do that?

What't the simplest way to accomplish this? If possible, I would like to avoid creating my own ANT build files and continue to use Eclipse's export tool and the IvyDE plugin.


回答1:


For me the following did the trick:

  • copy the ivy.xml to e.g. ivy-nodeploy.xml
  • create/select the configurations you want to include in the deployment assembly in ivy.xml
  • create/select the configurations you don't want to include in the deployment assembly in ivy-nodeploy.xml
  • add a new ivy-library to the build path where you change the default ivy-filename to ivy-nodeploy.xml

That way you still have all ivy managed libraries at compile time in your build path but only libraries configured in ivy.xml get included in the war file.




回答2:


Right click on your project's ivy.xml, and choose "Add ivy library".

In the main tab are customization settings for the build configs, and it looks as though you can choose the conf you desire (i.e. set it to runtime). I war using Ant, so I've never tried it. I presume this will accomplish what you desire.



来源:https://stackoverflow.com/questions/23207995/exclude-ivy-dependencies-in-war-file

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