Jenkins插件开发-Maven问题:未知包装:HPI [英] Jenkins plug-in developing - Maven issue: Unknown packaging: hpi
问题描述
我正在尝试开始使用Mac OSX为Jenkins开发插件.
I am trying to start developing plug-ins for Jenkins with Mac OSX.
首先,当我运行'mvn hpi:create'时,它花费了很长的时间 下载所有文件,每个文件最多下载几分钟.而且很多 文件.总时间是4-5个小时!为什么这么慢?
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?
然后,当我运行"mvn软件包"时,出现此错误:
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
为什么Maven不了解HPI?我使用的是Maven 3.0.4.
Why does maven not know about hpi? I use Maven 3.0.4.
这是我的pom.xml:
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>
我已经更改了< version> Jenkins到我计算机上的版本1.448. 我该如何解决此错误?
I have changed the <version> of Jenkins to the version on my computer, 1.448. How can I resolve this error?
推荐答案
它很慢,因为Maven Glassfish服务器当前已关闭,没有用于修复的ETA.詹金斯(Jenkins)伙计们建立了一个镜子,我们可以将其用作替代镜子.在您的 pom.xml 中,而不是m.g.o-public
存储库,请使用:
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>
此外,如本教程,以允许使用简称"hpi".
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".
这篇关于Jenkins插件开发-Maven问题:未知包装:HPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!