maven project与java,命令行太长。在Java项目中与maven

I have maven-gwt project. It has lots of dependencies which is usual by a large project. I think it is at the limit with creation of classpath. I found some information about the limitation. Allowed is 1023 Character. But I need the libraries.

I receive the following error when i want to package my project mit Maven.

The command line is too long.

How can I get around the problem.?

Here is the expanded error in Jenkins:

[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ MyProject ---

[INFO] Surefire report directory: C:\Documents and Settings\User\.jenkins\workspace\Myproject\target\surefire-reports

The command line is too long.

The command line is too long.

[ERROR] There are test failures.

解决方案

I found another workaround here http://code.google.com/p/gwt-maven/issues/detail?id=88

(I have problem with changing pom to fit a specific OS)

In short: make path to local repository as short as possible.

"

Comment 40 by gaurav.a...@gmail.com, Mar 23, 2009

One of the fix to the problem of "GWT compilation fails due to- The input line is

too long." is as follows:

Change m2(maven) repository. You might have your maven

repository at:

C:\Documents and Settings\MahcineNameABC\.m2

Copy settings.xml file from folder

apache-maven-2.0.8\apache-maven-2.0.8\conf into C:\Documents and Settings\MahcineNameABC\.m2

In settings.xml:

change the tag as

M:. Now your m2 home is a virtual M drive.

Create a repository folder as D:\maven-2.0.8\repository

Cut/Copy all the files/folders from C:\Documents and Settings\MahcineNameABC\.m2\repository to D:\maven-2.0.8\repository

Map local drive: open command prompt and execute (to create the

virtual drive):

subst M: D:\maven-2.0.8\repository. Now a virtual M drive will point to your repository.

Set environment variable M2_REPO with value M:

To enable long inputs, on command prompt execute:cmd /e:32768

This would fix the problem of long inputs due to very long entries in classpath

variables, at least in Win XP SP2. The inputs are combined and tested from comment#22

and #7.

Hope it helps!

This should help in most cases (and 'til the end of project - at least in my case)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值