This is set of plugin samples to be used with Go-server. Samples are provided with the intention of helping a plugin developer kick-start in a faster way. This sample is a maven project.
From Go version 14.4.0 Plugin implementation has changed from API based plugin to JSON based plugin. While we recommend writing all new plugins using the JSON based extension, the older API based plugin implementation will continue to exist for a few more releases.
The sample implementation for JSON based extension can be found under 'curl-plugin' folder. However, if you want to refer to the old API based implementation, you can refer the folder under 'curl-plugin-old-api-based'.
Following are steps to be followed to get started with the samples
All Go plugins needed to depend on Go plugin API jar. To get started, get a copy of API jar and place it inside some folder.
-
Sample plugins use maven for dependency resolution. The Go plugin API jar is now available through Maven central.
-
Run mvn clean install - this would build the plugins. Jars would be available in the 'target' folder of individual modules.
-
Copy these built jar files onto your Go Server's external plugins directory and restart the Go Server.
-
The Plugins tab under the Go server Administration will list the plugins installed and you should see the installed samples in the list.
-
You could open the project using the pom.xml in any IDE of your choice and play around with the code. Note: Once Go plugin API is installed to maven repo, there should be no errors related to plugin API.
For more information on building Go plugins, visit: http://www.go.cd/documentation/developer/writing_go_plugins/overview.html