0

Maven で SAKAI をビルドしようとすると、次のエラーが発生します。同じ問題に直面している人はいますか?また、最初に、sakai ソース フォルダー (sakai-src) にマスター フォルダーを作成します。通常、.m2 フォルダー ( c:/user/pc-user/.m2) 内に repository という名前のフォルダーが存在するはずですが、存在しません。

  • 堺10.7
  • Maven 3.3.1
  • トムキャット 7.0.72

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project external-calendaring-service-impl: There are test failures.
[ERROR]
[ERROR] Please refer to C:\apache\sakai-src\external-calendaring-service\impl\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :external-calendaring-service-impl
4

1 に答える 1

1

一部のテストが原因でビルドが失敗する場合があります。それらを除外することは、ビルドを続行するための最善の回避策の 1 つです。除外は、プラグインの excludes プロパティを構成することで実行できます。

Maven Surefire Plugin / テストの包含と除外

私の解決策は、 C:\apache\sakai-src\external-calendaring-service\impl\target\surefire-reports で失敗したテストをチェックインし、それらを pom.xml で除外することです。

  <project>
      [...]
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
              <excludes>
                <exclude>**/TestCircle.java</exclude>
                <exclude>**/TestSquare.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
      [...]
    </project>

別の解決策として、次の Maven コマンドを実行することもできます。

mvn clean install -X -e -DskipTests
于 2016-11-01T10:21:52.243 に答える