我很困惑felix-bundle插件。文檔中提到的Import-Package標籤Felix Bundle有很多錯誤的導入
該頭文件很少必須明確指定。然而,在某些情況下,當有一個不必要的進口,這樣的導入可以通過使用否定包模式
被刪除,但我建立一個插件,它似乎是進口很多東西,我不想。 javax.servlet和junit。*和org.junit。*和org.testng以及一些apache日誌包一樣。所有這些都讓我的包在使用中崩潰,並且缺少一個需求錯誤。
事情是,我不知道爲什麼這些被列入首位。很困惑。幫助歡迎。
對於答案AFAIK,我沒有在我的代碼中的任何地方使用javax.servlet。我的POM目前看起來像這樣。我不得不排除許多打包負載的軟件包。
所有的事情都變成了一場噩夢!
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>uk.org.russet</groupId>
<artifactId>uk.org.russet.protege.nrepl-clojure</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>protege-nrepl</name>
<description>Provide an NREPL client to use Clojure inside Protege</description>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>uk.org.russet</groupId>
<artifactId>nrepl-clojure</artifactId>
<version>1.0.0</version>
</dependency>
<!--dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>org.protege.common</artifactId>
<version>5.0.0-beta-05-SNAPSHOT</version>
<scope>provided</scope>
</dependency-->
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>org.protege.editor.core.application</artifactId>
<version>5.0.0-beta-05-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>org.protege.editor.owl</artifactId>
<version>5.0.0-beta-05-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-ClassPath>.</Bundle-ClassPath>
<Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName>
<Bundle-Vendor>The Protege Development Team</Bundle-Vendor>
<Import-Package>
!javax.servlet*,!junit.*,!org.junit*,!org.apache.*,
!org.testng.*,!sun.misc.*,org.protege.editor.*,
org.protege.editor.core,org.protege.editor.core.ui.workspace,
org.protege.editor.owl.model,org.protege.editor.core.editorkit,
org.semanticweb.owlapi.model, *
</Import-Package>
<Include-Resource>plugin.xml, {maven-resources}</Include-Resource>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>*;scope=compile</Embed-Dependency>
</instructions>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>install</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<pde>true</pde>
</configuration>
</plugin>
</plugins>
</build>
</project>
如果我使用javax.servlet,我會理解,但據我所知,我不是。 –
感謝您發佈配置。我懷疑這是你使用'Embed-Dependency'和'Embed-Transitive'的原因。這實際上將所有的構建依賴包括可傳遞的依賴包拉入你的包中。該插件然後檢查所有這些庫中的所有.class文件,並找出依賴關係。因此,發現您有大量的依賴關係正在生成並不奇怪。 –
如果我不這樣做,那麼我的包不會得到依賴關係,我的代碼也會失敗。我已經通過包含所有罐子的列表grep'd。他們都沒有junit,都沒有javax.servlet。這非常非常奇怪。我不知道他們來自哪裏! –