简体   繁体   English

使用 Maven Tycho 构建的更新站点缺少插件和功能文件夹

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

I am building an eclipse plugin with Tycho.我正在用 Tycho 构建一个 eclipse 插件。 I want to create an Update Site for it.我想为它创建一个更新站点。 I have the following components:我有以下组件:

  • parent (pom)父母(pom)
  • the plugin (eclipse-plugin)插件(eclipse-plugin)
  • the feature (eclipse-feature)功能(日食功能)
  • the update site (eclipse-repository)更新站点(eclipse-repository)

But when I run mvn clean package in the target folder of my update site project I have:但是当我在更新站点项目的目标文件夹中运行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

As you can see the plugin and feature folders are missing in target/repository .如您所见, target/repository中缺少pluginfeature文件夹。 This is my parent pom:这是我的父母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>

What am I doing wrong?我究竟做错了什么?

Thanks in advance.提前致谢。

UPDATE : As howlger requested here is update site's category.xml.更新:正如这里所要求的那样,更新站点的类别是.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>

By the way my file is named site.xml because if I named category.xml I have this error when i tried to run any maven goal:顺便说一句,我的文件被命名为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

I followed the instructions of the book Eclipse 4 Plug-in Development by Example Beginners Guide by Dr Alex Blewitt which uses an old version of tycho (0.18.0) and I have used 2.2.0.我按照Eclipse 4 Plug-in Development by Example Beginners Guide by Dr Alex Blewitt一书的说明使用了旧版本的 tycho (0.18.0),并且我使用了 2.2.0。 Maybe in this version they fixed the fact of renaming site to category since in the same book they mentioned that it was a meaningless change.也许在这个版本中,他们修复了将站点重命名为类别的事实,因为在同一本书中,他们提到这是一个毫无意义的更改。 I quote:我引用:

Rename the site.xml file to category.xml.将 site.xml 文件重命名为 category.xml。 (This is an entirely pointless change required by p2 since the files are identical in format.) (这是 p2 要求的完全没有意义的更改,因为文件格式相同。)

According the the error message ( ... lorem-ipsum-eclipse-update... Missing requirement: ... com.lorem.ipsum.eclipse.feature.feature.group... ) the update site category.xml refers a missing feature.根据错误消息( ... lorem-ipsum-eclipse-update... Missing requirement: ... com.lorem.ipsum.eclipse.feature.feature.group... )更新站点category.xml 。Z0F635D0E0F3874FFF7A7Z5 指缺少的功能。

Make sure to use the same feature ID ( <feature id="..." ) in the following two files:确保在以下两个文件中使用相同的功能 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 . 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 com.vogella.tycho.feature

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM