maven - 在为 xml 单元创建依赖项时在 pom.xml 中出现错误
问题描述
我想比较两个XML
文件,xmlunit
但是在尝试在 Maven 中为相同的文件创建依赖项时,我遇到了一个错误pom.xml
我使用了下面的依赖代码,但没有下载 jar 文件。试过下面的代码pom.xml
<dependency>
<groupId> xmlunit </groupId>
<artifactId> xmlunit </artifactId>
<version>1.6</version>
<scope>test</scope>
</dependency>
我想使用 maven 下载 XMLunit 的 jar 文件
解决方案
我不确定 groupId 和 artifactId 中的空白。我想这段代码应该可以工作:
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.6</version>
<scope>test</scope>
</dependency>
使用此命令运行您的项目
mvn clean install
或者
mvn dependency:resolve
如果你想通过使用 maven 下载这个单一的依赖,运行这个命令
mvn dependency:get -Dartifact=groupId:artifactId:version
推荐阅读
- javascript - Output all nested array elements with recursion
- php - 如何找到列总和达到某个数字的日期?
- symfony - 将外部 PHP 应用程序包含到 iFrame (Twig/Symfony)
- python - 在 Python 中发送 HTTP API 请求并将 json 数据转换为 csv 格式
- android - 启动应用程序时如何选择一个活动作为启动活动?
- javascript - 将 javascript 对象转换为 JSON
- c# - 使用 clientcontext.executequery() 上传文档和更新共享点库中的元数据时操作已超时
- python - 在列中查找字符串但在同一行下的不同列中返回值
- java - Spring Boot 2 自定义图标
- python - 如何将 Bokeh Tap 事件中的坐标附加到 python 对象?