【问题标题】:eclipse + maven + tomcat7 + wtp, can't start project when checked "Serve modules without publishing"eclipse + maven + tomcat7 + wtp,选中“服务模块而不发布”时无法启动项目
【发布时间】:2012-12-29 16:37:48
【问题描述】:

我在github上的项目:https://github.com/henryyan/kft-activiti-demo

一般不勾选“Serve modules without publishing”,项目就可以启动了。检查后发生错误(Tomcat6 是好的!!!):

引起:java.io.FileNotFoundException:/Users/henryyan/work/projects/activiti/kft-activiti-demo/src/main/webapp/WEB-INF/classes/applicationContext.xml(没有这样的文件或目录)

为什么要从“src”中找到文件“applicationContext.xml”,它应该是target/classes。

完整日志:https://gist.github.com/4407208

【问题讨论】:

    标签: eclipse maven tomcat7 eclipse-wtp


    【解决方案1】:

    我认为您需要将资源作为网络资源添加到 maven-war-plugin 中:

    <plugin>
       <artifactId>maven-war-plugin</artifactId>
       <version>2.1.1</version>
       <configuration>
          <webResources>
             <resource>                      
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
             </resource>
          </webResources>
       </configuration>
    </plugin>
    

    【讨论】:

    • 你在使用m2e吗?尝试删除您的 .settings 文件夹并在 Maven 菜单中执行“更新项目”。
    • 你能检查一下别的吗?打开 .settings/org.eclipse.wst.common.component 并检查它是否有一行
    • 是的, 在 .settings/org.eclipse.wst.common .component
    猜你喜欢
    • 2013-12-06
    • 1970-01-01
    • 2012-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-29
    相关资源
    最近更新 更多