2

2 つの依存関係があります。

<dependency>
    <groupId>org.postgis</groupId>
    <artifactId>postgis-jdbc</artifactId>
    <version>1.5.2</version>
</dependency>
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>com.springsource.org.postgresql.jdbc4</artifactId>
    <version>8.3.604</version>
</dependency>

両方の依存関係エクスポート パッケージ:

  • org.postgres

Maven Bundle Plugin のwrapコマンドを使用しているときに、postgis-jdbc からorg.postgresのエクスポートを除外するにはどうすればよいですか?

4

2 に答える 2

1

pom の config セクションに次を追加します。

<Export-Package>!org.postgres</Export-Package>

または、次の方法でパッケージを無視することもできます

<Export-Package>!*</Export-Package>
于 2012-10-22T20:43:07.900 に答える
0

Maven バンドル プラグインを使用して、選択したラップされた依存関係のパッケージ エクスポートを選択的に除外する実用的な方法を見つけることができませんでした。私の解決策は、代わりにcom.springsource.org.postgresql.jdbc4とpostgis -jdbc の両方をバンドルに埋め込み、それらのパッケージをエクスポートしないことでした。

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>2.3.7</version>
    <extensions>true</extensions>
    <configuration>
      <instructions>
            ...
            <Embed-Dependency>
                postgresql;postgis-jdbc
            </Embed-Dependency>
            ...
        </instructions>
    </configuration>
    <executions>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>bundle</goal>
           </goals>
        </execution>
    </executions>
</plugin>
于 2012-10-27T11:55:47.073 に答える