在log4j-config.xsd中没有targetNamespace。那么我们如何在没有targetNmaespace的情况下对log4j2.xml进行maven验证?
在log4j2.xml中,我想给出schemaLocation。
我的xml看起来像:
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://logging.apache.org/log4j/2.0/config"
xsi:schemaLocation="http://logging.apache.org/log4j/2.0/config https://arm.rnd.ki.sw.xxxx.se/artifactory/proj-switching-jcat-seki-release-local/se/ericsson/jcat/ebs/log4j/Log4j-config.xsd">
.....
</Configuration>
xsd看起来像:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"elementFormDefault="qualified" attributeFormDefault="unqualified">
......
</xs:schema>
PS:我不能在xsd中将“http://logging.apache.org/log4j/2.0/config”添加为targetNamespace。
答案 0 :(得分:0)
现在问题已经解决了。 我在github repo中添加了targetNamespace。
https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/resources/Log4j-config.xsd