Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Problem with M2E and OSGi runtime launch config

It does work with OSGi Framework launchers. We use them every day.

Two tricks are
1) Install the Tycho Configurator
2) configure the MBP to put the manifest in the place PDE expects it and
the plugin.xml if you use extension points

This is the profile I created to configure everything for PDE

<profiles>
		<profile>
			<id>in-eclipse</id>
			<!-- activated only when running in m2e (eclipse) -->
			<activation>
				<property>
					<name>m2e.version</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.felix</groupId>
						<artifactId>maven-bundle-plugin</
artifactId>
						<configuration>
							<manifestLocation>META-INF</
manifestLocation> <!-- PDE expects it in the root of the project -->
						</configuration>
					</plugin>
				</plugins>
				<resources>
					<resource>
						<!-- pde (project root) -->
						<directory>src/main/resources</
directory>
						<targetPath>${basedir}</targetPath>
						<includes>
							<include>plugin.xml</include>
						</includes>
					</resource>
					<resource>
						<!-- normal (output dir
, /target/classes) -->
						<directory>src/main/resources</
directory>
						<targetPath>$
{project.build.outputDirectory}</targetPath>
					</resource>
				</resources>
			</build>
		</profile>
	</profiles>



Alejandro Endo | Software Designer/Concepteur de logiciels




From:	Igor Fedorenko <igor@xxxxxxxxxxxxxx>
To:	m2e-users@xxxxxxxxxxx,
Date:	2013-07-14 09:00 AM
Subject:	Re: [m2e-users] Problem with M2E and OSGi runtime launch config
Sent by:	m2e-users-bounces@xxxxxxxxxxx



For projects that use maven-bundle-plugin (m-b-p for short), m2e-tycho,
despite the name, will execute m-b-p to generate bundle manifest as part
of eclipse workspace build. It will also make projects using m-b-p
visible to PDE tools, launch configuration in particular, so you can add
these projects to the list of bundles enabled in the launch configuration.

I only use this with "Eclipse Application" and "JUnit Plug-in Test" and
do not know if it works with "OSGi Framework" launch configurations.

Theoretically, you should not need to change anything in your pom.xml
files, but due to some PDE bugs I did not care to debug you have to
change location of generated bundle manifest to META-INF/manifest.mf. I
usually do this in pom profile activated by m2e.version property, so
regular command line build works as is. I also lock version qualifier
'.qualifier' (or any constant string, really) in the same profile to
avoid unnecessary workspace builds.

--
Regards,
Igor

On 2013-07-14 4:27 PM, Philipp Marx wrote:
> Hi Igor,
>
> yes I am talking about felix bundle-plugin. I am sorry I am not too
> familiar with the M2E connector infrastructure but I have done some
> googleing and try and error (unsuccessful) :)
>
> Do I understand it correct that through the connector every time I
> compile my sources M2E will invoke the Tycho plugin to generate the
> required PDE artifacts? Or does it only configure the project once (when
> importing)?
>
> For this to work, do I have to specify any particular life-cycle-mapping
> in my pom?
>
> Just to be sure: What I really want is to launch my maven bundle build
> with felix bundle-plugin as a OSGi bundle with the Eclipse OSGi runtime
> launch config :)
>
> Thanks.
>
> Cheers
> Philipp
>
> Are you talking about maven-bundle-plugin [1] or something else?
> Maven-bundle-plugin is supported by m2e-tycho, including integration
> with PDE launch support. This is what we use to package m2e maven
> runtime. You can install m2e-tycho either from m2e discovery catalog or
> directly from [2]
>
> [1]
http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
> [2]
>
http://nexus.tesla.io:8081/nexus/content/sites/m2e.extras/m2eclipse-tycho/0.7.0/N/0.7.0.201302171659/

>
>
> _______________________________________________
> m2e-users mailing list
> m2e-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-users
>
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



DISCLAIMER:

Privileged and/or Confidential information may be contained in this
message. If you are not the addressee of this message, you may not
copy, use or deliver this message to anyone. In such event, you
should destroy the message and kindly notify the sender by reply
e-mail. It is understood that opinions or conclusions that do not
relate to the official business of the company are neither given
nor endorsed by the company.

Thank You.



Back to the top