在log4j-config.xsd中没有targetNamespace。那么我们如何在没有targetNmaespace的情况下做log4j2.xml的maven验证?
问题描述:
在log4j-config.xsd中没有targetNamespace。那么我们如何在没有targetNmaespace的情况下做log4j2.xml的maven验证?在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” 为目标名称。
答
现在问题得到解决。 我在github回购中添加了targetNamespace。
https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/resources/Log4j-config.xsd