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

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

问题描述

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

  [错误]未知的包装:eclipse-plugin @第15行第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>父< / 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-插件由名为 Tycho 的Maven构建扩展名定义。为了使用Tycho的包装类型,您需要将Tycho配置为构建扩展名:

 < 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清单。与常规Maven项目相比,Tycho项目的另一个主要区别是您必须配置所谓的目标平台,例如通过定义具有 layout = p2 的存储库,以防您的项目引用任何外部工件。要开始使用,您可以查看此示例项目



有关详细信息,还可以查看 Tycho的文档wiki ,例如参考卡页面


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>

解决方案

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>

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.

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

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

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