'How can we set up Maven project in GoCD?

I have worked with Jenkins before. But we moved to GoCD now. I want to run a simple Maven project periodically for regression testing purposes.



Solution 1:[1]

As per their support forum:

You can use maven and Go together by using the "exec" builder of cruise.

Please do the following to set up maven with Go:

  1. Create a batch file(If you are on windows, else, .sh file) with the maven command you want to run through Go.
  2. While setting up the pipeline, choose "exec" as your builder and give the batch file name (created in step 1) and the parameters, if any.

Go recognizes build tools like ant, rake and nant; any other build tool can be integrated with cruise using the "exec" builder where you call the build commands through a batch file.

Solution 2:[2]

There is a Maven Task Plugin for GoCD.

Checkout the GoCD plugins overview: https://www.gocd.org/plugins/#task

To install a plugin, copy the JAR file to <server installation directory>/plugins/external then restart the GoCD server.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Prome
Solution 2 mihca