Я разрабатываю подключаемый модуль Eclipse и хотел бы использовать пакет Джерси OSGI, размещенный на SpringSource, но после того, как пакет будет извлечен, он не будет использован. Мой вопрос заключается в том, как мне объявить в моем POM или MANIFEST, что я хочу, чтобы пакет Джерси использовался как зависимость?
Мой проект состоит из простого сайта обновлений, функции, содержащей подключаемый модуль, и самого подключаемого модуля, созданных в соответствии с книгой: "Разработка подключаемых модулей Eclipse 4 на примере руководства для начинающих". Я использую Tycho в качестве инструмента сборки с родительским POM, содержащим информацию о целевой платформе, а другие проекты — в виде модулей.
Мой родительский 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.inin.testing.eclipse</groupId>
<artifactId>com.inin.testing.eclipse.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tycho-version>0.18.1</tycho-version>
<eclipse>http://download.eclipse.org/releases/kepler</eclipse>
</properties>
<modules>
<module>com.inin.testing.eclipse.update</module>
<module>com.inin.testing.eclipse.feature.testcase</module>
<module>com.inin.testing.eclipse.plugin.tcdb</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>kepler</id>
<layout>p2</layout>
<url>${eclipse}</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>core</artifactId>
<version>3.3.0-v_771</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>com.springsource.com.sun.jersey</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>
Плагин 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.inin.testing.eclipse</groupId>
<artifactId>com.inin.testing.eclipse.update</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<parent>
<groupId>com.inin.testing.eclipse</groupId>
<artifactId>com.inin.testing.eclipse.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
</project>
Я также добавил запись MANIFEST в проект плагина, как указано в SpringSource:
Import-Bundle: com.springsource.com.sun.jersey;version="[1.0.0,1.0.0]"
Когда я строю с помощью tycho, ошибок нет, но я не могу использовать ни один из классов, которые должны были быть импортированы с пакетом Jersey.
Я попытался переместить зависимость Джерси от родителя к дочернему POM с тем же результатом. Возможно, решение настолько очевидно, что я его не вижу, или я на совершенно неверном пути. Любая помощь будет здорово. Спасибо!