Note that there are some explanatory texts on larger screens.

plurals
  1. POTeamCity loads custom plugin, but there's no evidence the plugin code runs
    primarykey
    data
    text
    <p>I am playing around with a TeamCity install and developing a plugin that extends a BuildServerAdapter. When I package it up and install it to the server, teamcity-server.log contains entries for my plugin:</p> <ul> <li>found when scanning the plugins (.BuildServer\plugins) folder</li> <li>registering agent plugin from server plugin</li> <li>loads in the shared classloader</li> <li>is loaded</li> </ul> <p>The plugin is also listed on the plugins page in the server administration.</p> <p>Beyond that...nothing. I've put in various log statements, via both the logger and System.out, and I don't see them. I've even added an exception into the constructor, and I see no evidence of that either in the system logs. When a build happens, there's again no evidence that my code is called.</p> <pre class="lang-java prettyprint-override"><code>public class CustomBuildServerAdapter extends BuildServerAdapter { private SBuildServer myBuildServer; private static final Logger LOG = Logger.getLogger(CustomBuildServerAdapter.class); private void debug(String msg) { LOG.debug(msg); System.out.println(msg); } public CustomBuildServerAdapter(SBuildServer aBuildServer) throws Exception { throw new Exception("constructor is being called, at least we know that..."); //myBuildServer = aBuildServer; //debug("constructor"); } public void register() { debug("registering"); myBuildServer.addListener(this); debug("registered"); } public void buildFinished(SRunningBuild build) { debug("build finished"); postMessage(build.getFullName() + " - " + build.getStatusDescriptor().getText()); debug("message posted"); } ... </code></pre> <p>The zip that I copy to <code>.BuildServer\plugins</code> has the following structure:</p> <ul> <li>MyTeamCityPlugin.zip <ul> <li>teamcity.plugin.xml</li> <li>server</li> <li>MyTeamCityPlugin.jar <ul> <li>package folders containing class files</li> <li>META-INF <ul> <li>build-server-plugin.xml</li> <li>MANIFEST.MF</li> </ul></li> </ul></li> </ul></li> </ul> <p>Looking at other plugins, they use the following structure, so I've tried that as well.</p> <ul> <li>MyTeamCityPlugin.zip <ul> <li>MyTeamCityPlugin <ul> <li>teamcity.plugin.xml</li> <li>MyTeamCityPlugin.jar <ul> <li>package folders containing class files</li> <li>META-INF <ul> <li>build-server-plugin.xml</li> <li>MANIFEST.MF</li> </ul></li> </ul></li> </ul></li> </ul></li> </ul> <p>My build-server-plugin.xml contains the following:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&gt; &lt;beans default-autowire="constructor"&gt; &lt;bean id="myplugin" class="com.blah.blah.blah.CustomBuildServerAdapter" init-method="register"/&gt; &lt;/beans&gt; </code></pre> <p>I'm part of the way there since the teamcity-server.log does indicate it knows about the plugin, and no longer throws an exception trying to load it. Unfortunately, not erring isn't the same working. </p> <p>Using the ant build scripts from the sample plugin, I get the following error, so I've been packing things manually. This results in the seemingly successful load per above.</p> <blockquote> <p>Failed to initialize spring context for plugin MyTeamCityPlugin. Error creating bean with name 'simpleRunnerRunType': instantiation of bean failed.</p> </blockquote> <p>Can anyone give me the kick I need to get this running correctly?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload