簡體   English   中英

使用 Maven Tycho 構建的更新站點缺少插件和功能文件夾

[英]Missing plugin and feature folders for an update site built with Maven Tycho

我正在用 Tycho 構建一個 eclipse 插件。 我想為它創建一個更新站點。 我有以下組件:

  • 父母(pom)
  • 插件(eclipse-plugin)
  • 功能(日食功能)
  • 更新站點(eclipse-repository)

但是當我在更新站點項目的目標文件夾中運行mvn clean package時,我有:

├── lorem-ipsum-eclipse-update-1.0.1-SNAPSHOT.zip
├── local-artifacts.properties
├── p2agent
│   ├── org.eclipse.equinox.p2.core
│   │   └── cache
│   │       └── artifacts.xml
│   └── org.eclipse.equinox.p2.engine
│       └── profileRegistry
├── p2artifacts.xml
├── p2content.xml
├── repository
│   ├── artifacts.jar
│   ├── artifacts.xml.xz
│   ├── content.jar
│   ├── content.xml.xz
│   └── p2.index
└── targetPlatformRepository
    └── content.xml

如您所見, target/repository中缺少pluginfeature文件夾。 這是我的父母pom:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.lorem.ipsum.eclipse</groupId>
    <version>1.0.1-SNAPSHOT</version>
    <artifactId>lorem-ipsum-eclipse-parent</artifactId>
    <packaging>pom</packaging>

    <properties>
        <tycho-version>2.2.0</tycho-version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <modules>
        <module>lorem-ipsum-eclipse-feature</module> <!-- packaging: eclipse-feature -->
        <module>lorem-ipsum-eclipse-plugin</module>  <!-- packaging: eclipse-plugin -->
        <module>lorem-ipsum-eclipse-update</module>  <!-- packaging: eclipse-repository -->
    </modules>

    <repositories>
        <repository>
            <id>2020-12</id>
            <layout>p2</layout>
            <url>http://download.eclipse.org/releases/2020-12</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho-version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-p2-repository-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <includeAllDependencies>true</includeAllDependencies>
                    <createArtifactRepository>true</createArtifactRepository>
                    <compress>true</compress>
                </configuration>
            </plugin>
            <!--Enable the replacement of the SNAPSHOT version in the final product configuration-->
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-packaging-plugin</artifactId>
                <version>${tycho-version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <id>package-feature</id>
                        <configuration>
                            <finalName>${project.artifactId}_${unqualifiedVersion}.${buildQualifier}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

我究竟做錯了什么?

提前致謝。

更新:正如這里所要求的那樣,更新站點的類別是.xml。

<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature id="com.lorem.ipsum.eclipse.feature" version="0.0.0">
      <category name="com.lorem.ipsum.eclipse.category"/>
   </feature>
   <category-def name="com.lorem.ipsum.eclipse.category" label="Lorem Ipsum">
      <description>
         Contains features for Lorem Ipsum plugin
      </description>
   </category-def>
</site>

順便說一句,我的文件被命名為site.xml因為如果我命名為category.xml當我嘗試運行任何 maven 目標時我會遇到此錯誤:

$ mvn clean
...
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: lorem-ipsum-eclipse-update raw:1.0.1.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.0.1-SNAPSHOT
[ERROR]   Missing requirement: lorem-ipsum-eclipse-update raw:1.0.1.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.0.1-SNAPSHOT requires 'org.eclipse.equinox.p2.iu; com.lorem.ipsum.eclipse.feature.feature.group 0.0.0' but it could not be found
[ERROR] 
[ERROR] See https://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: com.globant.augmented.coding.eclipse:lorem-ipsum-eclipse-update:1.0.1-SNAPSHOT @ /home/me/workspaces/java/lorem-ipsum-eclipse-project/lorem-ipsum-eclipse-update/pom.xml: See log for details -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

我按照Eclipse 4 Plug-in Development by Example Beginners Guide by Dr Alex Blewitt一書的說明使用了舊版本的 tycho (0.18.0),並且我使用了 2.2.0。 也許在這個版本中,他們修復了將站點重命名為類別的事實,因為在同一本書中,他們提到這是一個毫無意義的更改。 我引用:

將 site.xml 文件重命名為 category.xml。 (這是 p2 要求的完全沒有意義的更改,因為文件格式相同。)

根據錯誤消息( ... lorem-ipsum-eclipse-update... Missing requirement: ... com.lorem.ipsum.eclipse.feature.feature.group... )更新站點category.xml 。Z0F635D0E0F3874FFF7A7Z5 指缺少的功能。

確保在以下兩個文件中使用相同的功能 ID ( <feature id="..." ):

  • <your-feature>/feature.xml
  • <your-update-site>/category.xml

See also the vogella tutorialEclipse Tycho for building Eclipse Plug-ins and RCP applications : in category.xml the feature is referenced via the ID com.vogella.tycho.feature .

com.vogella.tycho.feature

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM