分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 软件开发

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project sharp-common: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin

发布时间:2023-09-06 02:24责任编辑:沈小雨关键词:apache
 1 [INFO] Scanning for projects... 2 [INFO] ?3 [INFO] -----------------------< com.sharp:sharp-common >----------------------- 4 [INFO] Building sharp-common 0.0.1-SNAPSHOT 5 [INFO] --------------------------------[ jar ]--------------------------------- 6 [INFO] ?7 [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ sharp-common --- 8 [INFO] Deleting G:\worksheet\sharp-common\target 9 [INFO] 10 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ sharp-common ---11 [INFO] Using ‘UTF-8‘ encoding to copy filtered resources.12 [INFO] Copying 1 resource13 [INFO] Copying 0 resource14 [INFO] 15 [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ sharp-common ---16 [INFO] Changes detected - recompiling the module!17 [INFO] Compiling 1 source file to G:\worksheet\sharp-common\target\classes18 [INFO] 19 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ sharp-common ---20 [INFO] Using ‘UTF-8‘ encoding to copy filtered resources.21 [INFO] skip non existing resourceDirectory G:\worksheet\sharp-common\src\test\resources22 [INFO] 23 [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ sharp-common ---24 [INFO] Changes detected - recompiling the module!25 [INFO] Compiling 1 source file to G:\worksheet\sharp-common\target\test-classes26 [INFO] 27 [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ sharp-common ---28 [WARNING] The POM for org.apache.maven.reporting:maven-reporting-api:jar:3.0 is missing, no dependency information available29 [INFO] ------------------------------------------------------------------------30 [INFO] BUILD FAILURE31 [INFO] ------------------------------------------------------------------------32 [INFO] Total time: 1.759 s33 [INFO] Finished at: 2018-11-27T17:50:15+08:0034 [INFO] ------------------------------------------------------------------------35 [WARNING] The requested profile "pom.xml" could not be activated because it does not exist.36 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project sharp-common: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.22.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:2.22.1 -> org.apache.maven.surefire:maven-surefire-common:jar:2.22.1 -> org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.5.2: Failed to read artifact descriptor for org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.5.2: Failure to find org.apache.maven.plugin-tools:maven-plugin-tools:pom:3.5.2 in http://192.168.135.128:8081/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of my-nenux has elapsed or updates are forced -> [Help 1]37 [ERROR] 38 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.39 [ERROR] Re-run Maven using the -X switch to enable full debug logging.40 [ERROR] 41 [ERROR] For more information about the errors and possible solutions, please read the following articles:42 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

修改前pom

 1 <?xml version="1.0" encoding="UTF-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 ????xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4 ????<modelVersion>4.0.0</modelVersion> 5 ?6 ????<parent> 7 ????????<groupId>com.sharp</groupId> 8 ????????<artifactId>sharp-pom</artifactId> 9 ????????<version>0.0.1-SNAPSHOT</version>10 ????</parent>11 ????<artifactId>sharp-common</artifactId>12 ????<packaging>jar</packaging>13 14 ????<name>sharp-common</name>15 ????<description>公共模块</description>16 17 18 ????<dependencies>19 ?????<dependency>20 ?????????<groupId>org.springframework.boot</groupId>21 ?????????<artifactId>spring-boot-starter</artifactId>22 ??????</dependency>23 ?24 ??????<dependency>25 ?????????<groupId>org.springframework.boot</groupId>26 ?????????<artifactId>spring-boot-starter-test</artifactId>27 ?????????<scope>test</scope>28 ??????</dependency>29 ????</dependencies>30 ?????<build>31 ??????<plugins>32 ?????????<plugin>33 ????????????<groupId>org.springframework.boot</groupId>34 ????????????<artifactId>spring-boot-maven-plugin</artifactId>35 ?????????</plugin>36 ??????</plugins>37 ???</build>38 ????<distributionManagement>39 ????????<repository>40 ????????????<id>my-release</id>41 ????????????<url>http://xxxxxx:8081/repository/maven-releases/</url>42 ????????</repository>43 ????????<snapshotRepository>44 ????????????<id>my-snapshots</id>45 ????????????<url>http://xxxxxxx:8081/repository/maven-snapshots/</url>46 ????????</snapshotRepository>47 ????</distributionManagement>48 </project>

添加如下代码:<version>2.6</version> 信息缺失就会上述错误要注意

<plugin>
<groupId>org.apache.maven.plugins</groupId> ?????
<artifactId>maven-surefire-plugin</artifactId> ?????
<version>2.6</version>
<configuration>
<skipTests>true</skipTests>
</configuration> ?????
???</plugin>

变为

 1 <?xml version="1.0" encoding="UTF-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 ????xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4 ????<modelVersion>4.0.0</modelVersion> 5 ?6 ????<parent> 7 ????????<groupId>com.sharp</groupId> 8 ????????<artifactId>sharp-pom</artifactId> 9 ????????<version>0.0.1-SNAPSHOT</version>10 ????</parent>11 ????<artifactId>sharp-common</artifactId>12 ????<packaging>jar</packaging>13 14 ????<name>sharp-common</name>15 ????<description>公共模块</description>16 17 18 ????<dependencies>19 ?????<dependency>20 ?????????<groupId>org.springframework.boot</groupId>21 ?????????<artifactId>spring-boot-starter</artifactId>22 ??????</dependency>23 ?24 ??????<dependency>25 ?????????<groupId>org.springframework.boot</groupId>26 ?????????<artifactId>spring-boot-starter-test</artifactId>27 ?????????<scope>test</scope>28 ??????</dependency>29 ????</dependencies>30 ?????<build>31 ??????<plugins>32 ?????????<plugin>33 ????????????<groupId>org.springframework.boot</groupId>34 ????????????<artifactId>spring-boot-maven-plugin</artifactId>35 ?????????</plugin>36 ?????????<plugin> 37 ????????????<groupId>org.apache.maven.plugins</groupId> 38 ????????????<artifactId>maven-surefire-plugin</artifactId> 39 ????????????<version>2.6</version> ???40 ????????????<configuration> ???41 ????????????<skipTests>true</skipTests> ???42 ????????????</configuration> 43 ????????????</plugin>44 ??????</plugins>45 ???</build>46 ????<distributionManagement>47 ????????<repository>48 ????????????<id>my-release</id>49 ????????????<url>http://192.168.135.128:8081/repository/maven-releases/</url>50 ????????</repository>51 ????????<snapshotRepository>52 ????????????<id>my-snapshots</id>53 ????????????<url>http://192.168.135.128:8081/repository/maven-snapshots/</url>54 ????????</snapshotRepository>55 ????</distributionManagement>56 </project>

然后再次 clean install/deploy成功

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project sharp-common: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin

原文地址:https://www.cnblogs.com/xiaoyao-001/p/10027979.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved