Icon

You are viewing the documentation of TeamCity 9.x, which is not the most recently released version of TeamCity.
View this page in TeamCity 2018.x documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 
Skip to end of metadata
Go to start of metadata

You can easily develop TeamCity plugins with Maven.

Supported Maven versions

Both Maven 2 (2.2.1+) and Maven 3 (3.0.4+) are supported.

Open API in Maven Repository

TeamCity Open API is available as a set of Maven artifacts residing in the JetBrains Maven repository (http://download.jetbrains.com/teamcity-repository). Add this fragment to the <repositories> section of your pom file to access it:

Please note that only open API artifacts are present in the repository. If your plugin needs to use the not-open API, the corresponding jars should then be added to the project from the TeamCity distribution as they are not provided in the repository.

The open API in the repository is split into two main parts:

The server-side API:

The agent-side API:

(info) Note that API dependencies are used with the provided scope. This way you will avoid adding the API and its transitive dependencies to the target distribution.

There is also an artifact to support plugin tests:

Maven Archetypes

For a quick start with a plugin, there are three Maven archetypes in the org.jetbrains.teamcity.archetypes group:

  • teamcity-plugin - an empty plugin, includes both the server and the agent plugin parts
  • teamcity-server-plugin - an empty plugin, includes the server plugin part only
  • teamcity-sample-plugin - the plugin with the sample code (adds a "Click me" button to the bottom of the TeamCity project Overview page)

Here is the Maven command that will generate a project for a server-side-only plugin depending on 9.0 TeamCity version:

Here is the Maven command that will generate a project that contains both, the server and agent parts of a plugin and depends on 9.0 TeamCity version:

Here is the Maven command that will generate a sample project on 9.0 TeamCity version:

You will be asked to enter the usual Maven groudId, artifactId and version for your plugin. Please note, that artifactId will be used as your plugin (internal) name.
After the project is generated, you may want to update teamcity-plugin.xml in the root directory: enter display name, description, author e-mail and other information.

Finally, change the directory to the root of the generated project and run

The target directory of the project root will contain the <artifactId>.zip file. It is your plugin package, ready to be installed to TeamCity.

  • No labels