“命令行太长” - 运行maven测试时 [英] "The command line is too long" -- when running maven test
本文介绍了“命令行太长” - 运行maven测试时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在64位Windows上运行 $ mvn test
会给我下面的错误,即使我做了 $ mvn test -Dgwt.genParam = false :
命令行太长
解决方案
请确保您使用的版本 2.16
你有 useManifestOnlyJar
选项(如
<项目>
[...]
< build>
< pluginManagement>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-surefire-plugin< / artifactId>
< version> 2.16< / version>
<配置>
< useManifestOnlyJar> true< / useManifestOnlyJar>
< / configuration>
< / plugin>
< / plugins>
< / pluginManagement>
< / build>
[...]
< / project>
这将创建一个带有清单的jar,它重新创建类路径(而不是通过 CLASSPATH
变量,这是一种受Windows命令行限制问题影响的方法)。
Running $mvn test
on a 64-bit Windows gives me the following error, even if I do $mvn test -Dgwt.genParam=false
:
The command line is too long
解决方案
Make sure you are using version 2.16
and that you have the useManifestOnlyJar
option (as documented here).
For example:
<project>
[...]
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<useManifestOnlyJar>true</useManifestOnlyJar>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
[...]
</project>
This will create jar with a manifest that re-creates your classpath (as opposed to setting it via the CLASSPATH
variable which is an approach that is affected by Windows' command-line limit problem).
这篇关于“命令行太长” - 运行maven测试时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文