eclipse exception:File not found: .\target\m2e-wtp\web-resources\

eclipse exception:File not found: ..\target\m2e-wtp\web-resources\
eclipse exception:File not found: ..\target\m2e-wtp\web-resources\

What is this web resources folder
target/m2e-wtp/web-resources/ is a folder containing automatically generated resources, that need to be deployed on the application server. These generated resources are :

pom.properties and MANIFEST.MF generated by the mavenarchiver plugin
resources defined in the <webResources> section of the maven-war-plugin's configuration, or filtered web.xml
The target/m2e-wtp/web-resources/ is derived. In Eclipse lingo, it means it'll display a warning if you try to manually edit the files it contains, as they'll most likely be overridden automatically in the next (incremental or not) project build.

If you look in your <project>/.settings/ormon.component file, you will see /target/m2e-wtp/web-resources is defined BEFORE the regular war source directory :

<project-modules id="moduleCoreId" project-version="1.5.0">
   <wb-module deploy-name="webapp">
       <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
       <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
       <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
       <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
       <property name="context-root" value="webapp"/>
       <property name="java-output-path" value="/webapp/target/classes"/>
   </wb-module>
</project-modules>

The rationale behind this order is, if two files from two different source folders collide, WTP will deploy the first one it finds. So if you filter your web.xml sitting under src/main/webapp/WEB-INF, you will want the filtered version to be deployed on the server, that is target/m2e-wtp/web-resources/WEB-INF/web.xml. If, for some reason, you would like to disable the use of target/m2e-wtp/web-resources/, well, know that you can. i


修改myeclipse工程目录下.settings中:

org.eclipse.wst.common.component文件;

修改wb-resource顺序为:所要的排最上面

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="winshare-center">
        <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
    <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
        <property name="java-output-path" value="/winshare-center/target/classes"/>
        <property name="component.exclusion.patterns" value="build/**"/>
        <property name="context-root" value="winshare-center"/>
    </wb-module>
</project-modules>




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值