Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] how to create pom-first source bundles?

Hi Cristiano,

It might be possible to do something with the roots parameter in the manifest directive. Otherwise you would need to extract the sources from the jars into your main bundle. I've used the maven-bundle-plugin to do this specifically for a source bundle. Add the source maven deps as dependencies to your project (with sources classifier), then I've used the following snippet for the maven-bundle-plugin configuration.
 
<instructions>
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
<Bundle-SymbolicName>${bundle.name}.source</Bundle-SymbolicName>
<Bundle-Version>${bundle.version}</Bundle-Version>
<!-- This defines the bundle we provide the source for -->
<Eclipse-SourceBundle>${bundle.name};version="${bundle.version}";roots:="."</Eclipse-SourceBundle>
<!-- Extract all sources into this bundle -->
<Embed-Dependency>*;inline=true</Embed-Dependency>
</instructions>

Simon


On 5 January 2013 21:48, Cristiano Gavião <cvgaviao@xxxxxxxxx> wrote:
Hi Simon, thanks for sharing...

I'm consuming the pom-first bundles in a tycho build. I asked here with a hope that someone would have tried :)

I could create the source jar using the configuration you suggested, but it contains only the Activator class that I have added to the src/ of the bundle. Unfortunately, I couldn't find a way to include the sources from the embedded jars whose packages I'm exporting.

Do you know how could I achieve this?

thanks,

Cristiano



On 05/01/13 17:23, Simon Goodall wrote:
Hi Cristiano,

Tycho won't help you in this case. Eclipse source bundles need some extra manifest entries - they are OSGi bundles in their own right and also need a reference to the binary bundle they are the source for. Try adding something similar to the snippet below to the configuration for the maven-source-plugin;

<configuration>
<archive>
<!-- Generate required manifest headers to create a consumable source bundle in eclipse -->
<manifestEntries>
<Bundle-SymbolicName>${Bundle-SymbolicName}.source</Bundle-SymbolicName>
<Bundle-Version>${Bundle-QualifiedVersion}</Bundle-Version>
<Eclipse-SourceBundle>${Bundle-SymbolicName};version="${Bundle-QualifiedVersion}";roots:="."</Eclipse-SourceBundle>
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
</manifestEntries>
</archive>
</configuration>

Here Bundle-SymblicName is the symbolic name of your binary bundle and Bundle-QualifiedVersion is the full OSGi version number including qualifier (if present).

HTH,

Simon


On 5 January 2013 18:46, Cristiano Gavião <cvgaviao@xxxxxxxxx> wrote:
hello,

I'm using maven-bundle-plugin to create a pom-first bundle that wraps some non-osgi jars.

To be able to use it in eclipse debug I need to create a source bundle that includes the non-osgi source code. 

I have tried to use maven-source-plugin but its not working properly because it can't find any source...

could someone point me the way to achieve this ?

any tip is welcome...

thanks, Cristiano

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



Back to the top