私はEclipseプラグインを開発しています.tools.jarを依存関係として使用する必要があります。私たちが知っているように、Eclipseは通常のjarを依存関係として取りません。だから私はosgiバンドルとしてjarを変更しようとしました。ただし、生成された osgi バンドルには、com.sun パッケージが含まれていません。
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
pom で指定されたすべての依存関係をバンドルしようとしました。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nuwaza.aqua</groupId>
<artifactId>osgi-tool-bundle</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
<configuration>
<manifestLocation>META-INF</manifestLocation>
<instructions>
<Bundle-SymbolicName>osgi-tool-bundle</Bundle-SymbolicName>
<Bundle-Name>osgi-tool-bundle</Bundle-Name>
<Bundle-Version>1.0.0</Bundle-Version>
<Export-Package>*</Export-Package>
<Private-Package>com.nuwaza.aqua.bundle</Private-Package>
<Bundle-Activator>com.nuwaza.aqua.bundle.Activator</Bundle-Activator>
<Import-Package>*;resolution:=optional</Import-Package>
<Embed-Dependency>*;scope=compile|runtime|system</Embed-Dependency>
<Embed-Directory>target/dependency</Embed-Directory>
<Embed-StripGroup>true</Embed-StripGroup>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<profiles>
<profile>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<properties>
<osgi-version-qualifier>qualifier</osgi-version-qualifier>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<!-- PDE does not honour custom manifest location -->
<manifestLocation>META-INF</manifestLocation>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
生成されたバンドルには、パッケージでorg.osgi
はなくcom.sun
パッケージのみが含まれます。にシステム スコープも含めました<Embed-Dependency>*;scope=compile|runtime|system</Embed-Dependency>
。
私は何が欠けていますか?