马云新手...
我使用 git clone 下载了 XSpec:
git clone https://github.com/xspec/xspec.git
我设置了适当的环境变量。XSpec 似乎工作正常。
对于 Maven 插件,我正在使用:xspec-maven-plugin-1
为了创建一个 Maven 项目,我打开了一个(Windows)命令窗口并输入:
mvn -B archetype:generate -DgroupId=org.test.waypoints -DartifactId=waypoints -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4
这创建了一个航点文件夹以及几个子文件夹。
我在这个文件夹中放了一个 XSpec 测试(waypoints.xspec):waypoints/src/test/xspec
我将我的 XSLT 程序 (waypoints.xsl) 放在这个文件夹中:waypoints/src/main/xsl
我打开了 waypoints/pom.xml 并将下面显示的插件元素添加到 build/pluginManagement/plugins 中。
https://github.com/xspec/xspec-maven-plugin-1上的文档说:不要忘记向您的 Saxon license 添加依赖项。问题 #1:如何向我的 Saxon 许可证添加依赖项?我的 Saxon 许可证位于此文件夹中:C:\SAXON\saxon-license
我不知道如何添加该依赖项,但尽管如此,我还是继续前进。我在包含 pom.xml 的文件夹中打开了一个命令窗口并输入:
mvn test
这似乎没有多大作用。我收到了这条消息:Nothing to compile - all classes are up to date
问题 #2:我应该在命令之前运行其他一些 Maventest
命令吗?
问题 #3:Maven 如何知道使用 XSpec 代码?
问题#4:下面显示的插件元素看起来正确吗?
<plugin>
<groupId>io.xspec.maven</groupId>
<artifactId>xspec-maven-plugin</artifactId>
<version>2.0.0</version>
<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon-ee</artifactId>
<version>10.1</version>
</dependency>
<dependency>
<groupId>io.xspec</groupId>
<artifactId>xspec</artifactId>
<version>1.6.0</version>
</dependency>
</dependencies>
<configuration>
<generateSurefireReport>true</generateSurefireReport>
<saxonOptions></saxonOptions>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run-xspec</goal>
</goals>
</execution>
</executions>
</plugin>