如何防止tycho-p2-repository-plugin包含目标平台依赖项



我正试图使用Tycho为扩展Eclipse环境的插件创建一个P2存储库。当我尝试安装mvn时,它创建的zip文件会添加我不希望包含的org.eclipse.中的插件。

我已经定义了插件不包括依赖项(即使默认值已经是false)

  <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-p2-repository-plugin</artifactId>
          <configuration>
                  <includeAllDependencies>false</includeAllDependencies>
          </configuration>
  </plugin>

目前,它创建了一个至少48MB的zip文件。

eclipse存储库打包类型构建的p2存储库只包含模块的category.xml*.product文件(可传递)。"可传递包含"是指这些文件中列出的所有内容,以及包含在所包含功能中的所有内容。默认情况下,仅被引用的工件(例如,在捆绑清单中)不包括

因此,如果p2存储库包含太多工件,就不要包含工件或包含工件的特性。

如果您想要构建一个RCP,其中必须包含某些不应该进入p2存储库的内容,请将产品定义移动到一个单独的eclipse-repository模块中。

试试这个

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>prepare-feature-distribution</id>
                    <phase>package</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <mkdir
                                dir="${basedir}/target/${project.parent.artifactId}/${feature.version}" />
                            <!-- Copy core and targetPlatform jars -->
                            <copy
                                todir="${basedir}/target/${project.parent.artifactId}/${feature.version}">
                                <fileset dir="${basedir}/target/repository/plugins">
                                    <exclude name="ch.qos.logback.slf4j*.jar" />
                                    <exclude name="javax.xml.bind*.jar" />
                                    <exclude name="org.apache.xerces*.jar" />
                                    <exclude name="org.apache.xml.resolver*.jar" />
                                    <exclude name="org.apache.xml.serializer*.jar" />
                                    <exclude name="org.eclipse.equinox.common*.jar" />
                                    <exclude name="org.eclipse.equinox.ds*.jar" />
                                    <exclude name="org.eclipse.equinox.launcher.win32.win32.x86*.jar" />
                                    <exclude name="org.eclipse.equinox.launcher*.jar" />
                                    <exclude name="org.eclipse.equinox.util*.jar" />
                                    <exclude name="org.eclipse.net4j.jms.api*.jar" />
                                    <exclude name="org.eclipse.osgi.services*.jar" />
                                    <exclude name="org.eclipse.osgi*.jar" />
                                </fileset>
                            </copy>
                        </tasks>
                    </configuration>
                </execution>
            </executions>
        </plugin>

最新更新