jenkinsのメインページへのリンクを追加しようとしています。いくつかの例(私はJenkinsプラグインの開発に不慣れです)を調べた後、Notifierを拡張するクラスを作成する必要があるようです(他の場所で定義する必要はないようです?)そして実行ステップをオーバーライドします。
私は両方を試しました:
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
List<Action> installedActions = Hudson.getInstance().getActions();
BuildMonitorAction action = new BuildMonitorAction();
if(!installedActions.contains(action)){
Hudson.getInstance().getActions().add(action);
}
return true;
}
と:
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
List<Action> installedActions = Hudson.getInstance().getActions();
for (Action installedAction: installedActions) {
if (installedAction instanceof BuildMonitorAction) {
return true;
}
}
BuildMonitorAction action = new BuildMonitorAction();
Hudson.getInstance().getActions().add(action);
return true;
}
しかし、実行アクションは実行されていないようですか?
BuildMonitorActionは次のとおりです。
@ExportedBean (defaultVisibility = 999)
@Extension
public class BuildMonitorAction implements RootAction {
public String getDisplayName() {
return "grass is green";
}
public String getIconFileName() {
return null;
}
public String getUrlName() {
return "/buildmonitor";
}
}
「grasisgreen」という表示テキストのリンクがメインメニューに表示されない理由について、誰かが指摘していることはありますか?
そして別の質問:プロジェクトフォルダから削除する以外に、jenkins開発ワークスペースをクリアする方法はありますか?mvncleanはそれをクリアしていないようです。
前もって感謝します。