On Monday 07 February 2011 7:41:28 am Guillaume Nodet wrote:
> The bundle plugin has no knowledge of the source jar, but I think
> there are ways to configure the jar plugin to add additional manifest
> headers.
> I'm not using eclipse myself, but itsn't there any decent maven
> integration which would download and grab the source jar from the
> local repository?

When using an Eclipse OSGi "target platform", all the jars, including the 
sources jars, need to OSGi bundles and includes as part of the platform.

I rember last summer hacking away at the cxf bundles to get them working.   I 
believe they do now.    For the CXF bundles, we have:


                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Bundle-
SymbolicName>${bundle.symbolic.name}.source</Bundle-SymbolicName>
                                <Eclipse-
SourceBundle>${bundle.symbolic.name};version="${cxf.osgi.version.clean}"</Eclipse-
SourceBundle>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin> 

And then a big long and thing to calculate the version number.   (I had a 
groovy version of that script at one point.  Not sure why I didn't keep the 
groovy version).


Dan





> 
> On Mon, Feb 7, 2011 at 13:38, Christian Schneider
> 
> <ch...@die-schneider.net> wrote:
> > It would at least mean to add a minimal Manifest header.
> > 
> > In camel we do this manually:
> > ---------------
> > <plugin>
> > <groupId>org.apache.maven.plugins</groupId>
> > <artifactId>maven-source-plugin</artifactId>
> > <version>2.1.2</version>
> > <configuration>
> > <archive>
> > <manifestEntries>
> > <Bundle-SymbolicName>${project.groupId}.${project.artifactId}.source</Bun
> > dle-SymbolicName>
> > <Bundle-Version>${camel.osgi.version.clean}</Bundle-Version>
> > <Eclipse-SourceBundle>${project.groupId}.${project.artifactId};version="$
> > {camel.osgi.version.clean}"</Eclipse-SourceBundle> </manifestEntries>
> > </archive>
> > </configuration>
> > <dependencies>
> > <dependency>
> > <groupId>org.apache.camel</groupId>
> > <artifactId>camel-buildtools</artifactId>
> > <version>${project.version}</version>
> > </dependency>
> > </dependencies>
> > </plugin>
> > ---------------------
> > 
> > It would of course be much nicer if the bundle plugin could also put that
> > into the source jar. I do not know if it is possible though.
> > 
> > Christian
> > 
> > Am 07.02.2011 13:25, schrieb Guillaume Nodet:
> >> It seems that would require our sources jars to be packaged as osgi
> >> bundles, which isn't the case afaik.
> >> 
> >> On Monday, February 7, 2011, Christian Schneider
> >> 
> >> <ch...@die-schneider.net>  wrote:
> >>> We already have this header but I think it could perhaps be done by the
> >>> bundle plugin automatically.
> >>> 
> >>> The Manifest Header looks like:
> >>> Eclipse-SourceBundle:
> >>> org.eclipse.pde.core;version="3.4.0.N20071128-0010";roots:="ant_tasks/p
> >>> de-antsrc,." See:
> >>> http://dev.eclipse.org/mhonarc/lists/eclipse-dev/msg07890.html and
> >>> http://wiki.eclipse.org/PDE/FAQ
> >>> 
> >>> It just contains the id and version of the implementation bundle So
> >>> Eclipse can show you the sources when both bundles are in the target
> >>> platform.
> >>> 
> >>> Christian
> >>> 
> >>> 
> >>> Am 07.02.2011 11:55, schrieb Guillaume Nodet:
> >>> 
> >>> I don't recall anything in the maven bundle plugin about that.  Where
> >>> would we point to ? maven central ?
> >>> I suppose we could add that header in the root pom, though this would
> >>> also require a big of magic to get the full path I think, and that may
> >>> also fail for timestamped snapshots ....
> >>> 
> >>> On Mon, Feb 7, 2011 at 11:45, Christian Schneider
> >>> <ch...@die-schneider.net>    wrote:
> >>> 
> >>> Hi Guillaume,
> >>> 
> >>> I am just trying a buildd with that version.
> >>> Till now it looks good.
> >>> 
> >>> Btw. Do you know if the source.jars now also will be generated with the
> >>> "<Eclipse-SourceBundle>" manifest entry so you can click them in
> >>> Eclipse if
> >>> you work with a target platform? Or is this not part of the bundle
> >>> plugin?
> >>> 
> >>> Christian
> >>> 
> >>> 
> >>> Am 07.02.2011 11:31, schrieb Guillaume Nodet:
> >>> 
> >>> The maven-bundle-plugin 2.3.4 has just been released, so we could try
> >>> upgrading to that one.
> >>> 
> >>> On Mon, Feb 7, 2011 at 10:41, Christian Schneider
> >>> <ch...@die-schneider.net>      wrote:
> >>> 
> >>> Hi Guillaume,
> >>> 
> >>> that´s a typical case of misreading a specification on my side. It´s
> >>> good that I now read the spec again to proof you wrong. So I found
> >>> that I was wrong ;-)
> >>> 
> >>> The spec says.
> >>> version ::= major( '.' minor ( '.' micro ( '.' qualifier )? )? )?
> >>> 
> >>> I did not really be careful enough to read that qualifier is not meant
> >>> literally but rather stands for:
> >>> qualifier ::= ( alphanum | ’_’ | '-' )+
> >>> 
> >>> So you are right.
> >>> 
> >>> 2.7-SNAPSHOT in maven should be 2.7.0.SNAPSHOT in osgi.
> >>> 
> >>> Christian
> >>> 
> >>> Am 07.02.2011 10:11, schrieb Guillaume Nodet:
> >>> 
> >>> Not sure what you mean here, but the conversion should be 2.7-SNAPSHOT
> >>> ->        2.7.0.SNAPSHOT
> >>> 
> >>> 
> >>> Christian
> >>> 
> >>> --
> >>> ----
> >>> http://www.liquid-reality.de
> >>> 
> >>> 
> >>> 
> >>> --
> >>> ----
> >>> http://www.liquid-reality.de
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> --
> >>> ----
> >>> http://www.liquid-reality.de
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> --
> >>> ----
> >>> http://www.liquid-reality.de
> > 
> > --
> > ----
> > http://www.liquid-reality.de

-- 
Daniel Kulp
dk...@apache.org
http://dankulp.com/blog

Reply via email to