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

戏子无情 提交于 2019-12-01 06:39:10

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

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