Failure to find org.jenkins-ci.plugins:plugin


It seems that despite all the hard work of the Jenkins team to ensure a smooth move over to the new name, some of the maven repositories have not been updated just yet.

For me, this manifested in the error

Non-resolvable parent POM: Failure to find org.jenkins-ci.plugins:plugin:pom:1.399

As it turns out, the solution is to edit your user Maven config file, located in %USERPROFILE%\.m2\settings.xml (or ~/.m2/settings.xml on linux) to include URL’s to the repos. The following works like a charm:

<settings>
 <!-- Added Jenkins repositories -->
 <profiles>
   <profile>
     <id>jenkins</id>
     <activation>
       <activeByDefault>true</activeByDefault>
     </activation>
     <repositories>
       <repository>
         <id>java.net-m2-repository</id>
         <url>http://maven.jenkins-ci.org:8081/content/repositories/releases/
         </url>
       </repository>
     </repositories>
     <pluginRepositories>
       <pluginRepository>
         <id>jenkins-m2-repository</id>
         <name>Jenkins Plugin Repository</name>
         <url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url>
         <layout>default</layout>
       </pluginRepository>
       <pluginRepository>
          <id>maven.jenkins-ci.org</id>
          <url>http://maven.glassfish.org/content/groups/public/</url>
        </pluginRepository>
     </pluginRepositories>
   </profile>
 </profiles>
 <pluginGroups>
   <pluginGroup>org.jenkins-ci.tools</pluginGroup>
 </pluginGroups>
<!-- Hudson plugin group 
   <pluginGroups>
    <pluginGroup>org.jvnet.hudson.tools</pluginGroup>
  </pluginGroups>
-->
</settings>

Shout out to Lubos and Vojtech over on the Jenkins Plugin Tutorial Wiki article for figuring this out!

, ,

  1. #1 by psekar on May 20, 2011 - 10:08 pm

    made my day :)

  2. #2 by tomek on March 19, 2013 - 4:39 am

    thank you, this was exactly what I needed to start hacking m2release plugin (bumped into https://issues.jenkins-ci.org/browse/JENKINS-13465) thanks!

  3. #3 by steve on April 18, 2013 - 3:45 pm

    you sir, are a hero. thank you.

  4. #4 by John on June 4, 2013 - 7:13 pm

    Fantastic! saved me heaps of effort 😀

  5. #5 by Corneil du Plessis on September 19, 2013 - 6:10 am

    If you want to build and debug a plugin locally and you have not built any jenkins projects locally you will need to download the parent pom.
    Use the following:
    /mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -Dartifact=org.jenkins-ci.plugins:plugin:1.447 -Dorg.jenkins-ci.plugins -DrepoUrl=http://repo.jenkins-ci.org/public/ -Dpackaging=pom

    1.447 may be different for the parent of the plugin you want to build.

  6. #6 by uNople on May 24, 2015 - 3:44 pm

    Thanks heaps – this worked for me

(will not be published)