Maven学习12之跳过测试时surefire 2.19.1版本错误

错误:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MavenLearning 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.19.1/maven-surefire-plugin-2.19.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.462 s
[INFO] Finished at: 2016-05-10T16:50:17+08:00
[INFO] Final Memory: 7M/115M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.19.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.19.1: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.19.1 from/to central (https://repo.maven.apache.org/maven2): RSA premaster secret error: SunTlsRsaPremasterSecret KeyGenerator not available -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

换成2.18.1之后就可以了:

代码:

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>org.xubo.maven</groupId>
	<artifactId>MavenLearning</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>MavenLearning</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<junit.version>4.11</junit.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
			<scope>compile</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.18.1</version>
				<configuration>
					<skipTests>true</skipTests>
					<!-- <includes>
						<include>**/Hello*.java</include>
					</includes>-->
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>

结果:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MavenLearning 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MavenLearning ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\all\eclipse432\MavenLearning\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ MavenLearning ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ MavenLearning ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\all\eclipse432\MavenLearning\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ MavenLearning ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ MavenLearning ---
[INFO] Tests are skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.711 s
[INFO] Finished at: 2016-05-10T16:50:41+08:00
[INFO] Final Memory: 9M/167M
[INFO] ------------------------------------------------------------------------
时间: 2024-10-15 21:17:26

Maven学习12之跳过测试时surefire 2.19.1版本错误的相关文章

Maven包装过程中跳过测试

在具体项目,步骤需要跳过假设检验,应采取skipTests此属性设置为true. <pre name="code" class="html"><project> [...] <!--http://blog.csdn.net/redstarofsleep--> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins<

maven常用插件: 打包源码 / 跳过测试 / 单独打包依赖项

一 .打包同时生成源码 maven-source-plugin 1 <plugin> 2 <artifactId>maven-source-plugin</artifactId> 3 <version>2.4</version> 4 <executions> 5 <execution> 6 <phase>package</phase> 7 <goals> 8 <goal>ja

Maven打包跳过测试的命令

mvn clean 会把原来target目录给删掉重新生成.mvn install 安装当前工程的输出文件到本地仓库,然后打包mvn clean install 先删除target文件夹 ,然后打包到target 1.Maven打包跳过测试的命令 在使用mvn package进行编译.打包时,Maven会执行src/test/java中的JUnit测试用例,有时为了跳过测试,会使用参数-DskipTests和-Dmaven.test.skip=true,这两个参数的主要区别是:  -DskipT

Maven配置插件跳过测试代码的编译和运行

Maven配置插件跳过测试代码的编译和运行: <!-- 编译插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</targe

maven测试时中文乱码问题解决方法

pom.xml增加-Dfile.encoding=UTF-8配置,如下: 1 <plugin> 2 <!--升级到新版本解决控制台乱码问题--> 3 <groupId>org.apache.maven.plugins</groupId> 4 <artifactId>maven-surefire-plugin</artifactId> 5 <version>2.19.1</version> 6 <confi

Maven学习三 使用junit测试maven project

每个开发人员都会对自己的代码进行自定义的测试,可以是把项目run起来,手动点点页面按钮,看看操作场景和步骤点是否符合业务需要,是否存在UE上的问题.也有自己写几个测试类,把service类的输入输出是否符合标准都测试一番,这两大类,其实就是包括了前后端的测试工作,分工各有不同.在maven中集成了junit测试包,应该说maven可以集成任何你想的到或者想不到工具插件. 在maven project-01项目中引入junit插件并不困难,只需要在pom.xml中配置好依赖包即可(IDE环境下,依

Maven学习13之覆盖率测试

1.build的时候的goals为: cobertura:cobertura 2.运行之后在site下面可以看到html文件 3.运行记录: [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building MavenLearning 0.0.1-SNAPSHOT [INFO] --------

Maven学习总结

转载至:http://www.cnblogs.com/xdp-gacl/p/3498271.html 一 入门 一.Maven的基本概念 Maven(翻译为"专家","内行")是跨平台的项目管理工具.主要服务于基于Java平台的项目构建,依赖管理和项目信息管理. 1.1.项目构建 项目构建过程包括[清理项目]→[编译项目]→[测试项目]→[生成测试报告]→[打包项目]→[部署项目]这几个步骤,这六个步骤就是一个项目的完整构建过程. 理想的项目构建是高度自动化,跨平台

Maven学习

Maven简介 主要用于基于Java平台的项目构建.依赖管理和项目信息管理 约定优于配置(Convention Over Configuration),使项目构建标准化,消除重复及琐碎的任务,且提供中央仓库,通过坐标系统来有序地管理以来 核心是POM文件 本文是对<Maven实战>的学习和总结 坐标 没有Maven的情况下,开发中需要某个依赖时,得去它的官网上寻找,依赖多了之后,就得花费大量时间寻找和下载依赖,没有统一的规范.而Maven定义了一组规则:世界上任何一个构件都可以用Maven坐标