Eclipse gradle project's spring xml validation

一个人想着一个人 提交于 2019-11-30 09:41:40

问题


I have a gradle project in my Eclipse with a number of spring-integration context XMLs. These context XML files used to validate okay against the spring-integration schemas but now, for some reason, they are showing 'cvc-complex-type' errors. e.g. I have an element with an error-channel attribute. But on validation, it has started saying: "cvc-complex-type.3.2.2: Attribute 'error-channel' is not allowed to appear in element 'int:gateway'."

Now, looking in my Eclipse preferences' General -> Network Connections -> Cache, I can see that only spring-integration-1.0.xsd is in the cache (which wouldn't know anything about an error-channel attribute in gateway element), so I can see why the validation error appears. But, my project's classpath is working with spring-integration-core-2.2.0 so I would expect the spring context XMLs to validate against spring-integration-2.2.xsd schema, but it no longer does, for some unknown reason.

My spring context XMLs, have the following namespace declaration:

http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd.

Any ideas why the validation is not happening against spring-integration-2.2.xsd schemas any more? And what may have caused it?

The project itself, still compiles and runs okay as the project itself is aware of the 2.2 xsd schema, but not Eclipse.

Thanks for any help on this matter,

PM.


回答1:


Here is an answer: http://forum.spring.io/forum/spring-projects/integration/738046-eclipse-cannot-find-the-spring-integration-3-0-xsd-and-fails-validation Quote Gary:

If you enable "Spring Nature" on the project, STS should resolve the schemas from the jars.



来源:https://stackoverflow.com/questions/20656424/eclipse-gradle-projects-spring-xml-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!