Jenkins插件開發不適用於maven 2 (Jenkins plugin development not working with maven 2)


問題描述

Jenkins插件開發不適用於maven 2 (Jenkins plugin development not working with maven 2)

I am trying to get Jenkins' HelloWolrdBuilder example to work. Everything goes well when following this tutorial steps, but when I run Jenkins to test the example plugin, there is no build step for the plugin and no global configuration. In the plugin manager however, the plugins does appear to be installed. I noticed that this happens when using maven 2.2.1 but when I switched to maven 3.0.5  as mentioned here it works fine; however developing my plugin with maven 3 is not an option. Any ideas on how could I resolve this?


參考解法

方法 1:

After trying a lot of things that didn't work, I found this other tutorial which is very similar to the Jenkins' community tutorial but specifically states this:

If you are having problems with the latest Plugin version, you can also specify the version of the plugin that you want to use.
$ mvn ‑cpu org.jenkins‑ci.tools:maven‑hpi‑plugin:1.84:create

This workaround did the trick and now everything works fine.

EDIT: After digging a little bit deeper, I asked in the IRC channel and I was told that in fact maven 3 is now required to work with the latest version of the hpi‑plugin.

方法 2:

In order to make maven know what to do, you need to add following xml to your home maven directory ($HOME/.m2/settings.xml)

    <settings>
  <pluginGroups>
    <pluginGroup>org.jenkins‑ci.tools</pluginGroup>
  </pluginGroups>
  <profiles>
    <profile>
      <id>jenkins</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>repo.jenkins‑ci.org</id>
          <url>http://repo.jenkins‑ci.org/public/</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>repo.jenkins‑ci.org</id>
          <url>http://repo.jenkins‑ci.org/public/</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</settings>

I got this info from:  Link to Jenkins‑Plug‑in Tutorial

(by Esteban AngeeEsteban AngeeAlessandro Giusa)

參考文件

  1. Jenkins plugin development not working with maven 2 (CC BY‑SA 3.0/4.0)

#jenkins-plugins #maven #jenkins






相關問題

Email-ext Pre 腳本使用 (Email-ext Pre script usage)

分佈式 Jenkins - Linux 上的主控和 Windows 上的從屬 - 如何配置節點特定設置 (Distributed Jenkins- Master on Linux and slave on windows- How to configure node specific setting)

Jenkins插件開發不適用於maven 2 (Jenkins plugin development not working with maven 2)

Jenkins 全天運行構建和測試 (Jenkins running builds and tests all day long)

Jenkins jasmine-node 命令未找到 (Jenkins jasmine-node command not found)

在 jenkins 中更新 SVN 憑據 (Update SVN credentials in jenkins)

Jenkins 構建錯誤 - MSBUILD:錯誤 MSB1009:項目文件不存在 (Jenkins Build Error - MSBUILD : error MSB1009: Project file does not exist)

在初始分支創建時,jenkins 服務器中未配置 jenkinsfile 參數屬性 (jenkinsfile parameter properties not configured in jenkins server at initial branch creation)

如何將 Active Choices 反應參數傳遞給 Scriptler (How to Pass Active Choices Reactive Parameters to Scriptler)

配置通過 Dockerfile 安裝的 Jenkins 插件 (Configuring Jenkins plugin installed via Dockerfile)

使用觸發構建的用戶從 Jenkins 運行批處理作業 (Run a batch job from Jenkins with the user who triggered the build)

電子郵件擴展插件未加載通過配置文件提供程序插件添加的 groovy 模板 (Email Extension Plugin is not loading groovy template added via Config File Provider Plugin)







留言討論