Eclipse에서 프로젝트를 실행할 때 Maven2와 Spring 3을 사용할 때 모든 것이 정상적으로 작동하지만 assembly : assembly를 사용할 때 생성 된 jar는 다음 예외를 throw합니다.스프링 빌드 문제 - 콩 스키마를 찾을 수 없습니다.
Exception in thread "main"
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4
in XML document from class path resource [beans.xml] is invalid; nested exception
is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
element 'beans'.
내 콩 파일은 다음과 같이 보입니다 :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Beans Here -->
</beans>
이 파일은 SRC/메인/자원에 저장됩니다
내 pom.xml 파일 봄 다음과 같은 종속성이 :
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.3.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
왜 그런가? 어떻게 고치는 지?
UPDATE :
더 구글이 해결책이 향후 없지만 봄과 메이븐, 내 pom.xml 파일에 다음과 같이 너무 잘에 도착하지 않는 것이 밝혀 프로빙 : 문제
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<archive>
<manifest>
<mainClass>org.robert.xclades.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
감사합니다. 파일을 병합하는 것이 훨씬 좋을 것 같습니다. – Robert
사실, 전에 이걸 보았습니다. 왜 내가 전에 더 가까이 보지 않았는지 모르겠습니다. 감사! – javamonkey79