maven spring - Cannot find the declaration of element 'beans'
I know 2 situations where you can have this problem
- If you don't have an internet connection (behind a proxy, for instance). In that case, download the XSD, copy it next to the XML, and change the schema location to
xsi:schemaLocation=" http://www.springframework.org/schema/beans spring-beans-2.5.xsd ..."
- If you have an internet connection / still have the problem, that's because you use different versions of Spring for the XSD and the jar.
Spring jars contain META-INF/spring.handlers and META-INF/spring.schemas files. To avoid overwriting the files when aggregating dependencies to one jar you can use maven Shade plugin: