Eclipse Juno没有“看到”使用apache felix maven-bundle-plugin创建的包

时间:2013-06-02 15:52:13

标签: eclipse osgi apache-felix maven-bundle-plugin

这是我的问题:我目前正在Eclipse Juno中开发简单的RAP应用程序。我需要使用一些外部库,所以我用felix maven-bundle-plugin创建了一个包,我存储了一些库。之后,我将此包复制到Eclipse dropins 目录中。不幸的是,我无法将我的包添加到我的项目中的MANIFEST.MF(依赖项 - >必需的插件 - >添加),因为Eclipse没有看到它。

我已经在OSGI控制台中检查了我的包,一切似乎都没问题。状态已解决。我可以手动启动它而不会出现任何错误。 diag 命令也没有显示任何内容。

当我尝试在Eclipse Indigo中添加我的包时,一切正常 - 我可以在我的项目中使用它。

你知道可能出现什么问题吗?我正在为maven-bundle-plugin链接我的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <packaging>bundle</packaging>

    <groupId>org.myproject</groupId>
    <artifactId>some-dependencies</artifactId>
    <version>1.0.0</version>
    <name>Dependencies</name>
    <description>Dependency bundle</description>        

    <repositories>
        <repository>
            <id>maven-restlet</id>  
            <name>Public online Restlet repository</name>  
            <url>http://maven.restlet.org</url> 
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>14.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet.ext.json</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>1.4.0</version>
        </dependency>           
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.7</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>                      
                        <Export-Package>com.google.common.*,org.restlet.*,org.json.*</Export-Package>
                        <Import-Package>!sun.misc,*</Import-Package>                        
                        <Bundle-SymbolicName>some-dependencies</Bundle-SymbolicName> 
                        <Eclipse-BuddyPolicy>global</Eclipse-BuddyPolicy>
                    </instructions> 
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

2 个答案:

答案 0 :(得分:0)

要使PDE能够识别生成的清单文件,您必须使用M2e eclipse插件。 你必须在POM中设置这个包装:

<packaging>bundle</packaging>

答案 1 :(得分:0)

如果您正在开发RAP应用程序,则将针对RAP目标平台而不是正在运行的Eclipse平台进行编译。因此,添加到Eclipse运行时的bundle将无法用于工作区中的项目。您必须将捆绑包添加到目标平台。

您可以在RAP Developer's Guide中找到关于目标平台的简短解释。

相关问题