eclipse3.2版本使用maven

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

 

 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/是没用的),其他的版本安装不了,会有类似如下错误提示:

 

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会报如下异常:

[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中配置:

  <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>


如上,我使用的是2.0版本的 ,最后成功!!!!

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值