eclipse-rcp - 使用 tycho-p2-repository-plugin 创建带有父目录的 zip

标签 eclipse-rcp tycho

我在组装目标产品期间使用tycho-p2-repository-plugin。其 archive-repository 目标的默认行为是创建聚合 p2 存储库的 zip 存档。

我想知道如何将父repository目录包含在zip文件中?默认情况下,仅包含 repository 目录的内容。例如,如果您在 repository 目录中有 2 个文件 a.fileb.file,那么当您打开生成的 jar 时,您'看到这个

a.file 
b.file

但是,我想要的是 repository 目录本身成为 zip 中的第一层,如果深入研究它,您会看到其他层,如下所示:

repository/
   -> a.file
   -> b.file

如何让 tycho-p2-repository-plugin 来执行此操作?

最佳答案

据我所知,tycho-p2-repository-plugin 不允许自定义生成的 zip 文件的布局。

我们有一个类似的用例,我们必须从 p2 存储库的包中创建一个 WAR 文件,并因此使用 maven-assemble-plugin

这是我们在 pom.xml 中指定的内容:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <descriptors>
      <descriptor>assembly.xml</descriptor>
    </descriptors>
    <finalName>my-repo</finalName>
    <appendAssemblyId>false</appendAssemblyId>
  </configuration>
  <executions>
    <execution>
      <id>make-assembly</id>
      <phase>verify</phase>
      <goals>
        <goal>single</goal>
      </goals>
    </execution>
  </executions>
</plugin>

这是 assembly.xml 的样子:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">  <id>com.diwoblood.war</id>
  <formats>
    <format>war</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <fileSets>
    <fileSet>
      <directory>${basedir}/target/repository/</directory>
      <outputDirectory>/repository</outputDirectory>
    </fileSet>
  </fileSets>
</assembly>

关于eclipse-rcp - 使用 tycho-p2-repository-plugin 创建带有父目录的 zip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29710472/

相关文章:

java - Maven 多模块构建中的生命周期阶段

Eclipse JDT 和 Maven/Tycho 不同意警告

Eclipse RCP : Add image to list

java - Eclipse RCP 在 plugin.xml 扩展中没有图标

java - eclipse插件项目根目录

java - Maven + Tycho,添加 Maven 依赖

eclipse-plugin - 如何构建依赖于 Eclipse Birt 的 Eclipse 插件项目?

java - 获取 IStructuredSelection (eclipse-rcp) 的父项?

eclipse-plugin - 脏的 EditorPart 如何禁止 Eclipse 重命名其资源?

java - 无法安装本地构建的 eclipse 插件,获取 "Error reading signed content"