Esteban Angee
Esteban Angee

Reputation: 548

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?

Upvotes: 1

Views: 602

Answers (2)

Alessandro Giusa
Alessandro Giusa

Reputation: 1768

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

Upvotes: 0

Esteban Angee
Esteban Angee

Reputation: 548

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.

Upvotes: 2

Related Questions