当前位置:首页 > 服务端 > 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

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

 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 resource
13 [INFO] Copying 0 resource
14 [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\classes
18 [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\resources
22 [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-classes
26 [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 available
29 [INFO] ------------------------------------------------------------------------
30 [INFO] BUILD FAILURE
31 [INFO] ------------------------------------------------------------------------
32 [INFO] Total time: 1.759 s
33 [INFO] Finished at: 2018-11-27T17:50:15+08:00
34 [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成功

 

作者:醉逍遥_001
来源链接:https://www.cnblogs.com/xiaoyao-001/p/10027979.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125565.html

分享给朋友:

“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” 的相关文章