“未知包装:eclipse-plugin"在马文 [英] "Unknown packaging: eclipse-plugin" in Maven

查看:19
本文介绍了“未知包装:eclipse-plugin"在马文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 eclipse-plugin 打包在 Maven 中构建一个项目,但是我的 POM 出现以下错误:

I want to build a project in Maven using eclipse-plugin packaging, but I get the following error for my POM:

[ERROR] Unknown packaging: eclipse-plugin @ line 15, column 13 .

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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent> 
    <relativePath>../releng/pom.xml</relativePath>
    <groupId>net.sf.logsaw</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </parent> 

  <artifactId>net.sf.logsaw.core</artifactId>
  <version>1.0.4-SNAPSHOT</version>
  <packaging>eclipse-plugin</packaging> 

  <name>LogSaw Core Plugin</name> 
</project>

推荐答案

包装类型 eclipse-plugin 由名为 第谷.为了使用 Tycho 的打包类型,您需要将 Tycho 配置为构建扩展:

The packaging type eclipse-plugin is defined by a Maven build extension called Tycho. In order to use Tycho's packaging types, you need to configure Tycho as a build extension:

<build>
  <plugins>
    <plugin>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>tycho-maven-plugin</artifactId>
      <version>${tycho-version}</version>
      <extensions>true</extensions>
    </plugin>
  </plugins>
</build>

此外,Tycho 需要存在额外的元数据文件,例如eclipse-plugin 模块的 OSGi 清单.Tycho 项目与常规 Maven 项目相比的另一个主要区别是您必须配置所谓的 目标平台,例如通过使用 layout=p2 定义存储库,以防您的项目引用任何外部工件.要开始使用,您可以查看 这个示例项目.

Also, Tycho requires additional metadata files to be present, e.g. an OSGi manifest for eclipse-plugin modules. Another major difference of a Tycho project compared to a regular Maven project is that you have to configure the so-called target platform, e.g. by defining a repository with layout=p2, in case your project references any external artifacts. To get started, you may have a look at this example project.

有关更多信息,您还可以查看 Tycho 的文档 wiki,例如参考卡片页面.

For more information, you can also check out Tycho's documentation wiki, e.g. the reference card page.

这篇关于“未知包装:eclipse-plugin"在马文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆