展会信息港展会大全

Eclipse中常用的快捷键和模板配置
来源:互联网   发布日期:2016-01-14 14:24:41   浏览:3562次  

导读:eclipse安装maven插件,插件url:http://m2eclipse.sonatype.org/sites/m2e/(如何安装就不说了),目前,该地址提供4个maven版...

eclipse安装maven插件,插件url:http://m2eclipse.sonatype.org/sites/m2e/(如何安装就不说了),目前,该地址提供4个maven版本的安装:

view plain

0.10.0.20100209-0800/23-Nov-2010 22:38-

0.10.2.20100623-1649/23-Nov-2010 22:38-

0.12.0.20101115-1102/23-Nov-2010 22:38-

0.12.1.20110112-1712/18-Jan-2011 08:27-

经过实验,只有0.10.0.20100209-0800版本的可以进行安装(安装地址:http://m2eclipse.sonatype.org/sites/m2e/0.10.0.20100209-0800,只填http://m2eclipse.sonatype.org/sites/m2e/是没用的),其他的版本安装不了,会有类似如下错误提示:

view plain

Network connection problems encountered during search.

Unable to access "http://m2eclipse.sonatype.org/sites/m2e".

Error parsing site stream. [White spaces are required between publicId and systemId.]

Error parsing site stream. [White spaces are required between publicId and systemId.]

但是,0.10.0.20100209-0800版本的又只能eclipse3.3以上的才可以安装,eclipse3.2的不支持,所以必须安装maven更低的版本,低版本的maven可以在http://m2eclipse.sonatype.org/sites/archives/中寻找,本人使用的是0.9.7.200904021036这个版本的,安装成功!

在eclipse3.2版本安装0.9.7.200904021036版本的插件。使用maven package会报如下异常:

view plain

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8:test (default-test) on project mavenTest_01: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.8:test failed. NullPointerException -> [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/PluginExecutionException

经发现,是maven-surefire-plugin这个插件版本太高照成的,因为我的maven是3.0.3版本的,所以我改maven-surefire-plugin版本为2.10版本,发现还是同样错误,没道理啊,这个是对应3.0.3版本的啊,见http://maven.apache.org/plugins/。后来仔细想想,我的eclipse使用的插件是0.9.7.200904021036版本的,不知道是不是这个插件版本太低的原因,但是我的eclipse版本不支持高版本的插件,所以只好使用低版本的surefire。低版本的surefire版本好查询url:

http://svn.apache.org/repos/asf/maven/surefire/tags/,还有要修改使用surefire的其他版本,要在pom.xml中配置:

view plain

<build>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-surefire-plugin</artifactId>

<version>2.0</version>

<configuration>

<includes>

<include>**/*Test.java</include> 包含所有后缀为Test.jave的类

</includes>

</configuration>

</plugin>

</plugins>

</build>

摘自 Java, go's

赞助本站

人工智能实验室

相关热词: java 教程

相关内容
AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港