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