Jenkins plugin development - Maven problem: unknown packaging: hpi

I am trying to start developing plugins for Jenkins with Mac OSX.

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

Then, when I run the '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 doesn't maven know about hpi? I am using 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>mgo-public</id> <url>http://maven.glassfish.org/content/groups/public/</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>mgo-public</id> <url>http://maven.glassfish.org/content/groups/public/</url> </pluginRepository> </pluginRepositories> </project> 

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

+8
maven-3 jenkins jenkins-plugins
source share
1 answer

This is slow because the Maven Glassfish server is currently unavailable, without an ETA to fix it. The Jenkins guys created a mirror that we can use as a replacement. In pom.xml instead of mgo-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 data to your .m2/settings.xml as shown at the top of this tutorial to enable the use of the short name "hpi".

+5
source share

All Articles