0

是否可以从 p2-repository 解析自己的 eclipse-plugins 并将此插件用作 Maven-Dependency?我正在编写一个 Maven-Plugin,它也应该使用 Eclipse-Plugins。

<repositories>
    <repository>
        <id>p2-repository</id>
        <name>p2-repository</name>
        <url>https://company.de/artifactory/p2-repo</url>
    </repository>
</repositories>


<dependencies>
    <dependency>
        <groupId>de.own.plugin</groupId>
        <artifactId>de.own.plugin.eclipse</artifactId>
        <version>1.0.0-SNAPSHOT</version>       
    </dependency>
</dependencies>
4

1 回答 1

0

同时,至少有一个来自 OpenNTF的解决方案,下面是其中的一个片段:

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>p2-resolution.example</artifactId>
<version>0.0.1-SNAPSHOT</version>

<pluginRepositories>
    <!-- the plugin is hosted in OpenNTF's Maven repository -->
    <pluginRepository>
        <id>artifactory.openntf.org</id>
        <name>artifactory.openntf.org</name>
        <url>https://artifactory.openntf.org/openntf</url>
    </pluginRepository>
</pluginRepositories>

<repositories>
    <repository>
        <id>org.eclipse.p2.repo</id>   <!-- defines the groupId to be used below -->
        <url>http://download.eclipse.org/releases/2019-12</url>
        <layout>p2</layout>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.eclipse.p2.repo</groupId>   <!-- matches id of the repo above -->
        <artifactId>ch.qos.logback.slf4j</artifactId>
        <version>1.1.2.v20160301-0943</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.openntf.maven</groupId>
            <artifactId>p2-layout-resolver</artifactId>
            <version>1.2.0</version>
            <extensions>true</extensions>
        </plugin>
    </plugins>
</build>
</project>
于 2021-11-24T19:37:18.870 回答