【发布时间】:2013-11-25 08:25:55
【问题描述】:
我在两个 2 项目中使用 Spring。首先,我有一个“web”项目,它依赖于我的第二个项目,它是一个启用了 maven 特性的普通 java 项目,我将其命名为“core”。 所以,在我的“网络”项目中,我只是添加了我的“核心”项目的引用:
<dependency>
<groupId>com.stackoverflow</groupId>
<artifactId>core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
</dependency>
如果我像here 一样将属性“useProjectReferences”设置为 false,一切正常,但我正处于开发阶段,我不想每次在我的“核心”项目中发生变化时都运行 maven install。
我在 tomcat 中运行我的项目,所以我无法将它们打包在耳中。我想要的只是 Maven 将我的“src/main/resources”源文件夹导出到 Spring 能够找到我的 coreContext.xml 并绑定我的 bean。我在“核心”pom.xml 中尝试过的内容:
<build>
<resources>
<resource>
<directory>${basedir}src/main/resources</directory>
<targetPath>${basedir}WEB-INF/resources</targetPath>
</resource>
...
我尝试使用 shade-plugin 但也没有成功。任何提示将不胜感激。
【问题讨论】: