(1)
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
${java.version} maven官方解释是用来获取目标标签中的值,我开始以为是xml定义功能,实验后发现并不是,如图:
这个功能应该是pom在解析xml才能实现的。
(2) xml约束中xs:documentation主要是提供标签解释,并且必须包含在xs:annotation标签下。
下面是xml约束properties元素xml:
<xs:element minOccurs="0" name="properties">
<xs:annotation>
<xs:documentation source="version">4.0.0+</xs:documentation>
<xs:documentation source="description"> Properties that can be used throughout the POM as a substitution, and are used as filters in resources if enabled. The format is <code><name>value</name></code>. </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
当我们导入约束文件后,在对应元素上