【发布时间】:2011-02-19 06:54:03
【问题描述】:
我在 STS 2.5.1.RELEASE 中使用 Spring roo 创建了 Maven 项目(它是 Eclipse 3.6.1 + Spring tools + m2eclipse)。我在构建路径上有第二个简单的 Java 项目。在 Eclipse 中一切正常。
现在的问题是构建。我不能用 maven 这样做,因为它还要求引用的项目是 maven 项目。对于引用的项目,我只使用 Eclipse Export -> Runnable JAR file 来导出并生成 ant 文件以供下一次构建。
为第一个项目这样做,我得到运行时错误,即使 META-INF/spring/applicationContext.xml 既是 .jar 又在 .jar 旁边的文件夹中
2011-02-19 13:58:39,135-org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/applicationContext.xml]
2011-02-19 13:58:39,405-org.springframework.core.io.support.PathMatchingResourcePatternResolver - Cannot search for matching files underneath URL [rsrc:com/company/test/] because it does not correspond to a directory in the file system
java.io.FileNotFoundException: URL [rsrc:com/company/test/] cannot be resolved to absolute file path because it does not reside in the file system: rsrc:com/company/test/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)
引用的项目正在大力开发中,我无法移动、重构它或改变它的性质。 Spring roo 的 Maven 项目是并行版本待开发。
如何使用包含的eclipse项目构建maven项目?
示例。 项目 /RooInheritanceMaven 在其 (eclipse) 构建路径上有项目 /RooInheritanceJava。
.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/RooInheritanceJava"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
【问题讨论】:
标签: eclipse spring maven m2eclipse spring-roo