Which API is used by run button to execute maven plugin through maven2 build runner?

Hi All,
Does anybody know which TeamCity API is used by "Run" button to execute a given maven goal through maven2 Build runner?If anybody is familiar then please help me.
Thanks in advance,

Comment actions Permalink

Hi Mukesh,

Not sure what you mean by "execute maven plugin through maven2 build runner". Clould you please clarify.

The Run button invokes one of the SBuildType.addToQueue(...) methods depending on configured parameters. This is done for any build configuration with any type of runners. All the build specifics such as particular runners, number of steps, version control stuff, etc. is defined by a SBuildType object.

Comment actions Permalink

Hi Sergey,
we can also execute maven goal through TeamCity.In "Build Step:Maven2"(Third Configuation step) if we set goals property as <plugin's groupId>:<plugin's artifactId>:<plugin's version>:<plugin's goal> after that when we click on "Run" button then "Run" Button executes maven plugin mentioned above and writes results in log.I want to know to execute maven plugin which API is used by "Run" Button and which process does it use.

Comment actions Permalink

As I said above, pressing the button "Run" results in calling SBuildType.addToQueue(...). SBuildType is an object representation of a build configuration. To execute your build configuration you should first obtain the corresponding instance of SBuildType which can be done with the ProjectManager interface. For example if you know the id of your build configuration you can run it as follows:

ProjectManager pm;

String buildTypeId;

// ...

SBuildType myBT = pm.findBuildTypeById(buildTypeId);

if(myBT != null)

  myBt.addToQueue("launched by my plugin");


Please sign in to leave a comment.