Sorry, maybe I was not clear. I'm not suggesting that you should use tycho-maven-plugin. You need to install Tycho m2e connector - it provides Eclipse integration for both tycho-maven-plugin and maven-bundle-plugin.

Second thing is that you are not using maven-bundle-plugin properly. POM should look like this:

<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>Simple</groupId>
        <artifactId>Simple</artifactId>
        <packaging>bundle</packaging>
        <version>0.0.1-SNAPSHOT</version>
        <build>
                <plugins>
                        <plugin>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <version>2.3.2</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>                   
            
                        </plugin>
                </plugins>
        </build>
</project>


Important parts are that you should have <extensions>true</extensions> on maven-bundle-plugin AND you should use <packaging>bundle</packaging> for the project. This will cause bundle:bundle goal to kick in automatically in package phase. With Tycho connector present, your manifest should be automatically regenerated during incremental compilation.

Hope that helps,
Rafał

On 10/19/2012 03:51 PM, Andrew Mak wrote:
Hi Rafal, do you have any example of how to use Tycho in this way?

I had tried Tycho before and that seems to let me augment my POM with information from an existing manifest. But I would like to generate a manifest from the POM, which seems to work but I am running into the problem of it being overwritten during auto-build.

Thanks,

Andrew




From: Rafał Krzewski <[email protected]>
To: Maven Integration for Eclipse users mailing list <[email protected]>
Date: 10/18/2012 06:05 PM
Subject: Re: [m2e-users] Generating OSGi manifest in maven build
Sent by: [email protected]
------------------------------------------------------------------------



You need to install Tycho connector to integrate maven-bundle-plugin with m2e.

Cheers,
Rafał

On 10/18/2012 09:55 PM, Andrew Mak wrote:
Hi,

I'm new to m2e and Maven in general. I'm trying to generate an OSGi manifest file as part of my build.

Here's what I have done so far: I configured in my POM (attached) to call the "manifest" goal of the Maven bundle plugin, and associated it with the "process-classes" phase. It seems to work when I manually build the project; it would create a proper OSGi manifest in the target/classes/META-INF folder for me.

The problem is that it is only working when auto-build is turned off. When auto-build is on, there seems to be some other process that always overwrites the manifest file with a version that has almost no content at all. Does anyone have some idea why it is behaving this way?

By the way, when the m2e build runs, what phase/goal is it actually calling?




Thanks,

Andrew


_______________________________________________
m2e-users mailing list
[email protected]_ <mailto:[email protected]>
_https://dev.eclipse.org/mailman/listinfo/m2e-users_

_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users



_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users

Reply via email to