3

p2.inf ファイルで作成されたインストール可能なユニットを介してプラグインを構成するいくつかの機能を含む製品を (Eclipse リポジトリ モジュールで) 構築しています。

これは、 tycho-p2-director-pluginの構成パラメーターにデフォルト値targetPlatformを使用している限り機能します。私の知る限り、これにより、ディレクターはローカルの Maven リポジトリからp2 メタデータとアーティファクトにアクセスできます。source<project_dir>/target/targetPlatformRepository/context.xml

いくつかのバンドルを変更したいので、sourceパラメーターをに変更しましたrepository。これにより、ディレクターは生成されたリポジトリのアーティファクトとメタデータを使用し<project_dir>/target/repository、ビルドが壊れます;-)

p2.inf を介して作成されたインストール可能なユニットが完全であるのに欠落して<project_dir>/target/repository/content.jarいるよう<project_dir>/target/targetPlatformRepository/context.xmlです。たとえば、次のユニットは後者にのみ含まれます。

<unit id='configure.org.sample.bundle' ...>
  <!-- config -->
</unit>

そのインストール可能なユニットも に含めるようにビルドを構成するにはどうすればよいproject/repository/content.jarですか?

これが私の p2.inf ファイルのスニペットです。

# org.sample.bundle
requires.0.namespace=org.eclipse.equinox.p2.iu
requires.0.name=configure.org.sample.bundle
requires.0.greedy=true

units.0.id=configure.org.sample.bundle
units.0.version=1.0.0
units.0.provides.1.namespace=org.eclipse.equinox.p2.iu
units.0.provides.1.name=configure.org.sample.bundle
units.0.provides.1.version=1.0.0
units.0.instructions.install=org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bundle:${artifact});
units.0.instructions.configure=org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:2); org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:true);
units.0.hostRequirements.1.namespace=osgi.bundle
units.0.hostRequirements.1.name=org.sample.bundle
units.0.hostRequirements.1.greedy=false
units.0.hostRequirements.2.namespace=org.eclipse.equinox.p2.eclipse.type
units.0.hostRequirements.2.name=bundle
units.0.hostRequirements.2.range=[1.0.0,2.0.0)
units.0.hostRequirements.2.greedy=false
units.0.requires.1.namespace=osgi.bundle
units.0.requires.1.name=org.sample.bundle
units.0.requires.1.greedy=false

そして Tycho ビルドからのエラー:

Cannot complete the install because one or more required items could not be found.
Software being installed: sample 1.0.0.201308060715 (sample.product 1.0.0.201308060715)
Missing requirement: Sample Feature 1.0.0.201308060715 (sample.feature.feature.group
1.0.0.201308060715) requires 'configure.org.sample.bundle 0.0.0' but it could not be found
4

1 に答える 1

2

製品のインストールを作成するとき、p2 director は製品のすべての一時的な依存関係を解決する必要があります。ただし、デフォルトでは、eclipse-repository モジュール (通常はtarget/repository/) に組み込まれた p2 リポジトリは、含まれているコンテンツのみを集約します。

p2.inf 経由で作成されたユニットがtarget/repository/p2 リポジトリにないと言っているので、それらはおそらく機能には含まれておらず、依存関係としてのみ参照されています。p2.inf を変更して包含を生成することもできますが、これはおそらく最も簡単な解決策ではありません。

代わりに、単にtycho-p2-repository-pluginを構成して、包含だけでなくすべての依存関係を集約します。

<build>
  <plugins>
    <plugin>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>tycho-p2-repository-plugin</artifactId>
      <version>${tycho-version}</version>
      <configuration>
        <includeAllDependencies>true</includeAllDependencies>
      </configuration>
    </plugin>
  </plugins>
</build>

次に、 tycho-p2-director-pluginをターゲット プラットフォームから直接インストールするか、集約された p2 リポジトリからインストールするかは問題ではありません。

于 2013-08-05T14:01:52.317 に答える