“The command line is too long” — when running maven test

人走茶凉 提交于 2019-12-19 08:55:45

问题


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

回答1:


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



来源:https://stackoverflow.com/questions/22528099/the-command-line-is-too-long-when-running-maven-test

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!