Tuesday, September 15, 2015

How to resolve MojoExecutionException error when build the OpenOlat project?

Try to download the OpenOlat version 10.3 source code as a gzip file from its portal, unzip the source code and build the project in maven. MojoExecutionException error message as shown below is displayed when "mvn clean package" command is executed.

[ERROR] Failed to execute goal org.openolat.mojo:buildnumber-maven-plugin:1.2.0:
hgchangeset (default) on project openolat-lms: Command failed.
[ERROR] EXECUTION FAILED
[ERROR] Execution of cmd : id failed with exit code: 255.
[ERROR] Working directory was:
[ERROR] D:\Projects\OpenOlat\openolat103
[ERROR] Your Hg installation seems to be valid and complete.
[ERROR] Hg version: 3.5+5 (OK)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.openolat.mojo:buildnumber-maven-plugin:1.2.0:hgchangeset (default) on project
 openolat-lms: Command failed.
EXECUTION FAILED
  Execution of cmd : id failed with exit code: 255.
  Working directory was:
    D:\Projects\OpenOlat\openolat103
  Your Hg installation seems to be valid and complete.
    Hg version: 3.5+5 (OK)

Reason

The OpenOlet mojo plugin can't be found, please refer to pom.xml

<plugin> 
     <groupid>org.openolat.mojo</groupid>
     <artifactid>buildnumber-maven-plugin</artifactid>
     <version>1.2.0</version>
     <executions>
          <execution>
               <phase>validate</phase>
	       <goals>
	            <goal>hgchangeset</goal>
	       </goals>
	  </execution>
     </executions>
     <configuration>
          <docheck>true</docheck>
	  <doupdate>true</doupdate>
     </configuration>
</plugin>

The proper way to build OpenOlat should be
  • Install TortoiseHg version 3.5
  • Clone the OpenOlat source code from http://hg.openolat.org/openolat103
  • Rebuild the project with "mvn clean package" command, you should be able to build the war file.



No comments: