我正在玩TeamCity安装并开发一个扩展BuildServerAdapter的插件.当我打包并将其安装到服务器时,teamcity-server.log包含我的插件的条目:
该插件也列在服务器管理的插件页面中.
除此之外......没有.我通过logger和System.out输入了各种日志语句,但我没有看到它们.我甚至在构造函数中添加了一个异常,我在系统日志中看不到任何证据.当构建发生时,再次没有证据表明我的代码被调用.
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");
}
...
Run Code Online (Sandbox Code Playgroud)
我复制的zip .BuildServer\plugins包含以下结构:
看看其他插件,它们使用以下结构,所以我也试过了.
我的build-server-plugin.xml包含以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="constructor">
<bean id="myplugin" class="com.blah.blah.blah.CustomBuildServerAdapter" init-method="register"/>
</beans>
Run Code Online (Sandbox Code Playgroud)
我参与其中的方式,因为teamcity-server.log确实表明它知道插件,并且不再尝试加载它时抛出异常.不幸的是,不犯错误的是不一样的工作.
使用示例插件中的ant构建脚本,我收到以下错误,所以我一直在手动打包.这导致每个上面看似成功的负载.
无法为插件MyTeamCityPlugin初始化spring上下文.创建名为'simpleRunnerRunType'的bean时出错:bean的实例化失败.
任何人都可以给我一些踢,我需要正确运行吗?
该网站将其描述为简单(是的,如果它有效):
1. Shut down TeamCity server.
2. Copy the zip archive with the plugin to <TeamCity Data Directory>/plugins.
3. Start the TeamCity server: the plugin files will be unpacked and processed automatically.
Run Code Online (Sandbox Code Playgroud)
此处还提供了有关安装TeamCity插件的在线分步指南.
| 归档时间: |
|
| 查看次数: |
2751 次 |
| 最近记录: |