【问题标题】:How do I prevent tycho-p2-repository-plugin from including target platform dependencies?如何防止 tycho-p2-repository-plugin 包含目标平台依赖项?
【发布时间】:2013-02-16 11:43:21
【问题描述】:

我正在尝试使用 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 文件。

【问题讨论】:

    标签: tycho


    【解决方案1】:

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

    因此,如果 p2 存储库包含太多工件,则根本不包括工件或包含工件的功能。

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

    【讨论】:

      【解决方案2】:

      试试这个

      <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>
      

      【讨论】:

        猜你喜欢
        • 2019-01-02
        • 2012-04-30
        • 1970-01-01
        • 2018-08-14
        • 2012-01-24
        • 2011-08-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多