문제

Here's my problem: I'm currently developing simple RAP application in Eclipse Juno. I was in need to use some external libraries so I created a bundle with felix maven-bundle-plugin where I had stored some libraries. After that I copied this bundle into the Eclipse dropins directory. Unfortunately I'm unable to add my bundle into my project in MANIFEST.MF (Dependencies -> Required Plug-ins -> Add) cause Eclipse does not see it.

I've checked my bundle in OSGI console and everything seems to be fine. Status is RESOLVED. I can start it manually without getting any errors. Also diag command shows nothing.

When I tried to add my bundle in Eclipse Indigo everything worked fine - I could use it in my project.

Do you have any idea what may be wrong? I'm linking my pom.xml for maven-bundle-plugin:

<?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>
도움이 되었습니까?

해결책

If you're developing a RAP application, you'll compile it against a RAP target platform, not the running Eclipse platform. Therefore, a bundle added to the Eclipse runtime will not be available to projects in your workspace. You have to add your bundle to the target platform.

You can find a brief explanantion on target platforms in the RAP Developer's Guide.

다른 팁

To able PDE to recognize the generated manifest file, you must use the M2e eclipse plugin. and you must set this packaging in you POM:

<packaging>bundle</packaging>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top