You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steinar Bang <sb...@dod.no> on 2006/12/14 18:07:41 UTC

Generating eclipse source plugins?

We're using maven to generate OSGi bundles, and then use the
dependency-maven-plugin to copy some of these bundles to the directory
$HOME/pde_target_platform/plugins/ where we also copy the bundles that
make up the eclipse runtime.  We then set the directory
$HOME/pde_target_platform/ as the PDE target platform.

If we want to debug into these OSGi bundles, there should be a
subdirectory in the $HOME/pde_target_platform/plugins/ directory,
containing a plugin.xml defining an org.eclipse.pde.core.source
extension.  See the below URL for the form of an "eclipse source
plugin":
	http://wiki.eclipse.org/index.php/Source_Bundles

The source plugins also have WEB-INF/MANIFEST.MF files that define the
directories to be OSGi bundles.  But I don't know how important these
manifests are from eclipe's POV.

My question is: has anyone ever created such eclipse source plugins
using maven?

One complication is that the source plugins are directories rather
than JARs.  I don't know if they have to be.  Can maven handle
artifacts that are directories?  Or do they have to be single files?
Can the dependency-maven-plugin be persuaded to unpack a JAR into a
directory, when installing into $HOME/pde_target_platform/plugins/?

Thanx!


- Steinar


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Generating eclipse source plugins?

Posted by Tom Huybrechts <to...@gmail.com>.
On 12/14/06, Steinar Bang <sb...@dod.no> wrote:
> >>>>> "Tom Huybrechts" <to...@gmail.com>:
>
> >> One complication is that the source plugins are directories rather
> >> than JARs.  I don't know if they have to be.  Can maven handle
> >> artifacts that are directories?  Or do they have to be single files?
> >> Can the dependency-maven-plugin be persuaded to unpack a JAR into a
> >> directory, when installing into $HOME/pde_target_platform/plugins/?
>
> > If I remember correctly, you need a directory per bundle. Inside that
> > bundle, you create one src.zip file corresponding to the classes in
> > the root of your bundle-classpath, and one XXXsrc.zip per embedded
> > XXX.jar
>
> I just successfully created one using a bourne shell script.  The
> structure looked like this, as seen from the PDE target platform
> plugins directory:
>   bundlename-source-bundleversion/
>   bundlename-source-bundleversion/META-INF/MANIFEST.MF
>   bundlename-source-bundleversion/plugin.xml
>   bundlename-source-bundleversion/src/bundlesymbolicname_bundleversion/src.zip
>
> (the reason for injecting the extra directory under src, was that
> that's what eclipse's own source plugins did.  But when I think of it,
> I did it wrong.  Because eg. GEF's structure is to have one directory
> for each actual bundle it carries source for.  I used the source
> bundle's bundle name.   But I think it doesn't matter since it just
> scans down the src file, finds zip files and looks for source in them)
>
> > I doubt the manifest is important, just the plugin.xml should do...
>
> The MANIFEST.MF had to be there for eclipse to plug it up as a
> plugin.  I tried both with and without.
>
> I didn't try paring the manifest down to a minimum, I more or less
> copied one of an eclipse source bundle and changed what was
> appropriate, but I believe what minimally has to be there, is
> Bundle-SymbolicName and Bundle-Version.
>
> Those are the two values that show up in the Plug-ins explorer
> treeview.
>
> So now the question is whether it's possible to coerce maven into
> creating something similar...?

Sure it is.... Maybe it's possible to coerce the dependency or
assembly plugin into doing something useful, but the simplest is
probably to create a little maven plugin for it...

tom


>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Generating eclipse source plugins?

Posted by Steinar Bang <sb...@dod.no>.
>>>>> "Tom Huybrechts" <to...@gmail.com>:

>> One complication is that the source plugins are directories rather
>> than JARs.  I don't know if they have to be.  Can maven handle
>> artifacts that are directories?  Or do they have to be single files?
>> Can the dependency-maven-plugin be persuaded to unpack a JAR into a
>> directory, when installing into $HOME/pde_target_platform/plugins/?

> If I remember correctly, you need a directory per bundle. Inside that
> bundle, you create one src.zip file corresponding to the classes in
> the root of your bundle-classpath, and one XXXsrc.zip per embedded
> XXX.jar

I just successfully created one using a bourne shell script.  The
structure looked like this, as seen from the PDE target platform
plugins directory:
  bundlename-source-bundleversion/
  bundlename-source-bundleversion/META-INF/MANIFEST.MF
  bundlename-source-bundleversion/plugin.xml
  bundlename-source-bundleversion/src/bundlesymbolicname_bundleversion/src.zip

(the reason for injecting the extra directory under src, was that
that's what eclipse's own source plugins did.  But when I think of it,
I did it wrong.  Because eg. GEF's structure is to have one directory
for each actual bundle it carries source for.  I used the source
bundle's bundle name.   But I think it doesn't matter since it just
scans down the src file, finds zip files and looks for source in them)

> I doubt the manifest is important, just the plugin.xml should do...

The MANIFEST.MF had to be there for eclipse to plug it up as a
plugin.  I tried both with and without.

I didn't try paring the manifest down to a minimum, I more or less
copied one of an eclipse source bundle and changed what was
appropriate, but I believe what minimally has to be there, is
Bundle-SymbolicName and Bundle-Version.

Those are the two values that show up in the Plug-ins explorer
treeview. 

So now the question is whether it's possible to coerce maven into
creating something similar...?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Generating eclipse source plugins?

Posted by Tom Huybrechts <to...@gmail.com>.
> One complication is that the source plugins are directories rather
> than JARs.  I don't know if they have to be.  Can maven handle
> artifacts that are directories?  Or do they have to be single files?
> Can the dependency-maven-plugin be persuaded to unpack a JAR into a
> directory, when installing into $HOME/pde_target_platform/plugins/?

If I remember correctly, you need a directory per bundle. Inside that
bundle, you create one src.zip file corresponding to the classes in
the root of your bundle-classpath, and one XXXsrc.zip per embedded
XXX.jar

I doubt the manifest is important, just the plugin.xml should do...

tom

>
> Thanx!
>
>
> - Steinar
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org