“命令行太长"-- 运行 maven 测试时 [英] "The command line is too long" -- when running maven test

查看:96
本文介绍了“命令行太长"-- 运行 maven 测试时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 64 位 Windows 上运行 $mvn test 会给我以下错误,即使我执行 $mvn test -Dgwt.genParam=false:

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

推荐答案

确保您使用的是 2.16 版本,并且您有 useManifestOnlyJar 选项(作为 此处记录.

Make sure you are using version 2.16 and that you have the useManifestOnlyJar option (as documented here).

例如:

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

这将创建带有重新创建类路径的清单的 jar(而不是通过 CLASSPATH 变量设置它,这是一种受 Windows 命令行限制问题影响的方法).

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆