#匹配通配符是严格的,但没有声明可以为元素找到“上下文:注解配置”
它的工作距离的IntelliJ IDE,但是创建罐子,在我的本地执行后不能正常工作,#匹配通配符是严格的,但没有声明可以为元素找到“上下文:注解配置”
的jdk - 1.5
弹簧 - 3.1.0-RELEASE
所致: org.xml.sax.SAXParseException; lineNumber:7; columnNumber:33; cvc-complex-type.2.4.c:匹配通配符是严格的,但是对元素'context:annotation-config'没有声明。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:annotation-config/>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
<property name="searchSystemEnvironment" value="true"/>
<property name="locations">
<list>
<value>classpath:log/dev.properties</value>
</list>
</property>
<property name="ignoreResourceNotFound" value="false"/>
</bean>
</beans>
的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.logger</groupId>
<artifactId>logger</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>logger</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>logger</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.TestLogger</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>package-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.1.1.RELEASE</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
</dependencies>
</project>
问题是与已创建其中有罐子的方式所需要的外部依赖
额外的配置看看这个解决方案 How to create a jar with external libraries included in Eclipse?
感谢Mudassar的快速回复。添加pom.xml, 您可以请让我知道什么可能是在编译期间的额外配置 –
是否为你工作 – Mudassar
尝试在模式位置的春天版本以及。 –