【发布时间】:2019-06-10 18:50:27
【问题描述】:
我的 pom.xml 文件有问题,当我现在在 jenkins 中运行我的构建时,我立即得到了这个结果:
错误:格式错误的 POM C:\Program Files (x86)\Jenkins\workspace\sonarqube-trigger-prueba\pom.xml:无法识别的标签:'dependency'。
第 23 行第 14 列
我已经包含了'JUNit 5的依赖'的部分,但是我仍然有同样的问题。
我需要这方面的帮助。
非常感谢。
我已经更改了 pom.xml,但我没有不同的结果,所以..
我需要这方面的帮助。 非常感谢。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<dependencies>
<groupId>org.springframework</groupId>
<artifactId>gs-spring-boot</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--dependencia de JUNit5 -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<properties>
<java.version>1.8</java.version>
</properties>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
-
所有的依赖只能是isside dependencies标签。
-
那么我应该把第二个依赖项放在第一个依赖项中,然后将所有内容合二为一吗?
-
查看maven中pom.xml的结构
标签: java jenkins sonarqube pom.xml