Jenkins插件开发-Maven问题:未知打包:hpi

发布于 2024-12-28 18:56:58 字数 1792 浏览 3 评论 0原文

我正在尝试开始使用 Mac OSX 为 Jenkins 开发插件。

首先,当我运行“mvn hpi:create”时,需要很长时间才能 下载所有文件,每个文件最多几分钟。而且还很多 文件数量。总时间4-5小时!为什么这么慢?

然后,当我运行“mvn package”时,出现此错误:

[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?我使用 Maven 3.0.4。

这是我的 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> 

我已经更改了Jenkins 到我电脑上的版本,1.448。 我该如何解决这个错误?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在巴黎塔顶看东京樱花 2025-01-04 18:56:58

它很慢,因为 Maven Glassfish 服务器当前已关闭,并且没有预计修复时间。詹金斯的人已经设置了一面镜子,我们可以用它来代替。在您的 pom.xml 中,而不是使用 mgo-public 存储库,请使用:

<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>

另外,将详细信息添加到您的 .m2/settings.xml本教程顶部所示,允许使用简短的命名为“hpi”。

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文