【发布时间】:2018-06-19 06:57:40
【问题描述】:
我有一个 maven 父级,我在其中为插件定义了 1 个模块。
父 pom 如下所示:
<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>
<groupId>com.angle</groupId>
<artifactId>angle-eclipse</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<modules>
<module>../com.angle.ui</module>
</modules>
<properties>
<java.version>1.8</java.version>
<tycho-version>1.0.0</tycho-version>
<oxygen-repo.url>http://download.eclipse.org/releases/oxygen</oxygen-repo.url>
<goal.preset>clean install</goal.preset>
</properties>
<repositories>
<repository>
<id>oxygen</id>
<layout>p2</layout>
<url>${oxygen-repo.url}</url>
</repository>
</repositories>
<build>
<!-- <defaultGoal>${goal.preset}</defaultGoal> -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
</build>
该模块是一个插件,我已将其性质转换为 Maven。
模块的 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>
<name>com.angle.ui</name>
<description>UI part of the plug-in</description>
<parent>
<groupId>com.angle</groupId>
<artifactId>angle-eclipse</artifactId>
<version>1.0.0</version>
<relativePath>../angle-eclipse</relativePath>
</parent>
<artifactId>com.angle.ui</artifactId>
<packaging>eclipse-plugin</packaging>
现在,即使我已将 tycho-maven-plugin 添加为构建插件,但它给了我错误:项目构建错误:未知包装:eclipse-plugin,我无法构建 maven 项目。
没有其他错误。
我也搜索了其他帖子,但他们给出的唯一解决方案是将 tycho-maven-plugin 作为构建插件包含在父 pom 中,这种方法并不能解决我的问题。
请帮我解决这个问题。
【问题讨论】:
-
@Stultuske 它不是重复的。正如我的问题中提到的,我已经尝试过这种方法,但它不起作用。
-
你尝试了多少这种方法?
-
我试过添加tycho-maven-plugin的插件。
-
建议的“方法”远不止于此。如果您只实施了建议解决方案的 25%,那么它确实有可能不起作用
标签: java eclipse maven eclipse-plugin tycho