0
因此,我創建了一個簡單的團隊城市通知程序,該通知程序目前只會將一些信息記錄到我的C驅動器中,但是無論何時在TeamCity上觸發構建時,通知程序都不會運行。我不知道我錯過了什麼。這是迄今爲止我所擁有的。 MyLogger類只是獲取一個簡單的java.util.logging.Logger對象,該對象在C驅動器上創建一個日誌。TeamCity自定義通知程序未運行
這是我實現Notificator接口:
import java.util.Collection;
import java.util.Set;
import java.util.logging.Logger;
import jetbrains.buildServer.Build;
import jetbrains.buildServer.notification.Notificator;
import jetbrains.buildServer.notification.NotificatorRegistry;
import jetbrains.buildServer.responsibility.ResponsibilityEntry;
import jetbrains.buildServer.responsibility.TestNameResponsibilityEntry;
import jetbrains.buildServer.serverSide.SBuildType;
import jetbrains.buildServer.serverSide.SProject;
import jetbrains.buildServer.serverSide.SRunningBuild;
import jetbrains.buildServer.serverSide.STest;
import jetbrains.buildServer.serverSide.mute.MuteInfo;
import jetbrains.buildServer.tests.TestName;
import jetbrains.buildServer.users.SUser;
import jetbrains.buildServer.vcs.VcsRoot;
public class TestNotificator implements Notificator {
private Logger log;
public TestNotificator(NotificatorRegistry nR) {
log = MyLogger.getLogger();
log.info("Registering the Notificator");
nR.register(this);
}
public void doNotifications(SRunningBuild arg0) {
log.info("Do Notifications has been called");
}
@Override
public String getDisplayName() {
return "Test Notificator";
}
@Override
public String getNotificatorType() {
return "testNotificator";
}
@Override
public void notifyBuildFailed(SRunningBuild arg0, Set<SUser> arg1) {
log.info("Build has failed");
doNotifications(arg0);
}
@Override
public void notifyBuildFailedToStart(SRunningBuild arg0, Set<SUser> arg1) {
// TODO Auto-generated method stub
}
@Override
public void notifyBuildFailing(SRunningBuild arg0, Set<SUser> arg1) {
// TODO Auto-generated method stub
}
@Override
public void notifyBuildProbablyHanging(SRunningBuild arg0, Set<SUser> arg1) {
// TODO Auto-generated method stub
}
@Override
public void notifyBuildStarted(SRunningBuild arg0, Set<SUser> arg1) {
// TODO Auto-generated method stub
}
@Override
public void notifyBuildSuccessful(SRunningBuild arg0, Set<SUser> arg1) {
log.info("Build was Successfull");
doNotifications(arg0);
}
@Override
public void notifyLabelingFailed(Build arg0, VcsRoot arg1, Throwable arg2,
Set<SUser> arg3) {
// TODO Auto-generated method stub
}
@Override
public void notifyResponsibleAssigned(SBuildType arg0, Set<SUser> arg1) {
// TODO Auto-generated method stub
}
@Override
public void notifyResponsibleAssigned(TestNameResponsibilityEntry arg0,
TestNameResponsibilityEntry arg1, SProject arg2, Set<SUser> arg3) {
// TODO Auto-generated method stub
}
@Override
public void notifyResponsibleAssigned(Collection<TestName> arg0,
ResponsibilityEntry arg1, SProject arg2, Set<SUser> arg3) {
// TODO Auto-generated method stub
}
@Override
public void notifyResponsibleChanged(SBuildType arg0, Set<SUser> arg1) {
// TODO Auto-generated method stub
}
@Override
public void notifyResponsibleChanged(TestNameResponsibilityEntry arg0,
TestNameResponsibilityEntry arg1, SProject arg2, Set<SUser> arg3) {
// TODO Auto-generated method stub
}
@Override
public void notifyResponsibleChanged(Collection<TestName> arg0,
ResponsibilityEntry arg1, SProject arg2, Set<SUser> arg3) {
// TODO Auto-generated method stub
}
@Override
public void notifyTestsMuted(Collection<STest> arg0, MuteInfo arg1,
Set<SUser> arg2) {
// TODO Auto-generated method stub
}
@Override
public void notifyTestsUnmuted(Collection<STest> arg0, MuteInfo arg1,
SUser arg2, Set<SUser> arg3) {
// TODO Auto-generated method stub
}
}
這裏集結服務器的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="testNotifier" class="com.testnot.TestNotificator"/>
</beans>
我打包類和構建服務器的plugin.xml在一起在同一個罐子裏。在jar中有兩個單獨的目錄,它們是com.testnot和META-INF。也許我沒有正確打包它們。我不完全確定我做錯了什麼。任何幫助,如此永遠將不勝感激。我一直在使用找到的示例here.
Beuller,Beuller,任何人,任何人......?大聲笑。 =) – 2012-04-26 16:08:47