[ http://jira.codehaus.org/browse/MECLIPSE-103?page=comments#action_65651 ] 

Martin Vysny commented on MECLIPSE-103:
---------------------------------------

I tried to write a howto on building an eclipse plugin with maven2 
<http://vyzivus.host.sk/maven2-build-plugin-howto.html> and I propose the 
following: if user wants to build an eclipse plugin then eclipse goal should in 
addition ensure that:

1. .project file contains additional elements in the <buildSpec> element:
                <buildCommand>
                        <name>org.eclipse.pde.ManifestBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.pde.SchemaBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>

2. .project file: the <natures> element should contain an additional <nature> 
element:
                <nature>org.eclipse.pde.PluginNature</nature>

3. we should somehow differentiate between dependencies defined in pom.xml that 
are regular jar libraries, and the eclipse-bundles dependencies. I have created 
a small maven2 repository containing eclipse bundles 
<http://delo.dcs.fmph.uniba.sk/sioux/maven2>. Currently the eclipse bundles 
have groupId equal to 'eclipse.bundles' and their artefact Id like 
'org.eclipse.gef'. So let's say for now that eclipse bundles dependencies are 
such dependencies that have 'eclipse.bundles' as their groupId.

4. eclipse bundles dependencies must not be present in the .classpath file, 
instead, the META-INF/MANIFEST.MF should be modified to contain:
Bundle-Name: ${project.name}
Bundle-SymbolicName: ${project.artifactId}; singleton:=true
Bundle-Version: ${project.version}
Bundle-Vendor: ${project.organization.name}
Export-Package: just export all packages in all sourcepaths for now.
Require-Bundle: org.eclipse.core.runtime,
 org.eclipse.jface,
 org.eclipse.swt,
 org.eclipse.draw2d
 ... here all the eclipse bundles dependencies artifactId should be present.

5. .project file: the <linkedResources> element should contain link for every 
regular dependency, to mimic the deployed plugin structure. I propose to place 
each regular dependency as a link into the lib/ directory, for example:
                <link>
                        <name>lib/stax-api-1.0.jar</name>
                        <type>1</type>
                        
<locationURI>M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar</locationURI>
                </link>
                <link>
                        <name>lib/stax-1.1.2-dev.jar</name>
                        <type>1</type>
                        
<locationURI>M2_REPO/stax/stax/1.1.2-dev/stax-1.1.2-dev.jar</locationURI>
                </link>
                <link>
                        <name>lib/ikslibs-0.3-SNAPSHOT.jar</name>
                        <type>1</type>
                        
<locationURI>M2_REPO/sk/baka/ikslibs/ikslibs/0.3-SNAPSHOT/ikslibs-0.3-SNAPSHOT.jar</locationURI>
                </link>

6. linkedResources uses its own variables, so we need to define M2_REPO 
variable (identical to the one defined in EclipseProperties > Java > Buildpath 
> Classpath) in EclipseProperties > General > Workspace > Linked Resources.

7. the META-INF/MANIFEST.MF should contain one more entry:
Bundle-ClassPath: ${artifactId}-${version}.jar,
 lib/stax-api-1.0.jar,
 lib/stax-1.1.2-dev.jar,
 ... all regular dependencies.

What do you think?

> Plugin should add required classpath entry if user specified a PluginNature 
> for a project
> -----------------------------------------------------------------------------------------
>
>          Key: MECLIPSE-103
>          URL: http://jira.codehaus.org/browse/MECLIPSE-103
>      Project: Maven 2.x Eclipse Plugin
>         Type: New Feature

>     Reporter: Rahul Thakur
>  Attachments: MECLIPSE-103.patch
>
>
> If the user specified a "org.eclipse.pde.PluginNature" in the configuration, 
> the plugin should add a "org.eclipse.pde.core.requiredPlugins" entry to 
> .classpath. Atleast this will enable Eclipse to recognise a PDE project.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to