在log4j-config.xsd中没有targetNamespace。那么如何在没有targetNmaespace的情况下对log4j2.xml进行maven验证呢?

时间:2016-09-21 14:46:48

标签: java xml maven xsd xsd-validation

在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。

1 个答案:

答案 0 :(得分:0)

现在问题已经解决了。 我在github repo中添加了targetNamespace。

https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/resources/Log4j-config.xsd