0

When i tried to build SAKAI with maven i encounter the following error. Is there anyone faced with the same problem? Also firstly i build master folder in sakai source folder (sakai-src) normally there should be a folder named repository inside .m2 folder (c:/user/pc-user/.m2) but don't exist.

  • Sakai 10.7
  • Maven 3.3.1
  • Tomcat 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

1 Answers1

1

There are certain times when some tests are causing the build to fail. Excluding them is one of the best workarounds to continue the build. Exclusions can be done by configuring the excludes property of the plugin.

Maven Surefire Plugin / Inclusions and Exclusions of Tests

My solution would be to check in C:\apache\sakai-src\external-calendaring-service\impl\target\surefire-reports for the failed tests and exclude them in your 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>

Another solution might be to run the following Maven command:

mvn clean install -X -e -DskipTests
Community
  • 1
  • 1
0x44656E6E79
  • 1,053
  • 3
  • 14
  • 21
  • Firstly thanks very much, second solution which you suggested resolved my problem but why couldn't create repository folder in .m2 folder? –  Nov 01 '16 at 12:52
  • If you provide me with full log, I could make a guess. For starters you could check your log for [INSTALL] tags. This shows you the path where the jars are about to be saved. If you can't find any lines with [INSTALL] than Maven might be cancelled the download of the dependencies base on the failed tests. Also the folder could be hidden, maybe. – 0x44656E6E79 Nov 01 '16 at 14:12