Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins plug-in developing - Maven issue: Unknown packaging: hpi

I am trying to start developing plug-ins for Jenkins with Mac OSX.

First, when I run 'mvn hpi:create', it takes a reeaally long time to download all the files, up to several minutes per file. And it's a lot of files. Total time is 4-5 hours! Why is it so slow?

Then, when I run 'mvn package' I get this error:

[ERROR]   
[ERROR]   The project org.sample.jenjondev:firstplugin:1.0-SNAPSHOT
(/Users/jonatanekstedt/Developer/jenkins/firstplugin/pom.xml) has 1 error
[ERROR]     Unknown packaging: hpi @ line 12, column 14

Why does maven not know about hpi? I use Maven 3.0.4.

This is my pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:// 
    www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:// 
    maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
  <modelVersion>4.0.0</modelVersion> 
  <parent> 
    <groupId>org.jenkins-ci.plugins</groupId> 
    <artifactId>plugin</artifactId> 
    <version>1.448</version><!-- which Jenkins version is this plugin 
        built against? --> 
  </parent> 

  <groupId>org.sample.jenjondev</groupId> 
  <artifactId>firstplugin</artifactId> 
  <version>1.0-SNAPSHOT</version> 
  <packaging>hpi</packaging> 

  <repositories> 
    <repository> 
      <id>m.g.o-public</id> 
      <url>http://maven.glassfish.org/content/groups/public/</url> 
    </repository> 
  </repositories> 
  <pluginRepositories> 
    <pluginRepository> 
      <id>m.g.o-public</id> 
      <url>http://maven.glassfish.org/content/groups/public/</url> 
    </pluginRepository> 
  </pluginRepositories> 
</project> 

I have changed the <version> of Jenkins to the version on my computer, 1.448. How can I resolve this error?

like image 839
JonatanEkstedt Avatar asked Jan 25 '12 13:01

JonatanEkstedt


1 Answers

It's slow because the Maven Glassfish server is currently down, with no ETA for a fix. The Jenkins guys have set up a mirror that we can use as a replacement. In your pom.xml, instead of the m.g.o-public repos, use:

<project>
...
<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>
 ...
</project>

Also, add the details to your .m2/settings.xml as shown at the top of this tutorial to allow the use of the short name "hpi".

like image 168
Jon Cairns Avatar answered Nov 16 '22 02:11

Jon Cairns