You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Graham Leggett <mi...@sharp.fm> on 2007/06/11 15:50:15 UTC

maven-eclipse-plugin and PDE: do dependencies work?

Hi all,

I have been having an interesting time trying to get some eclipse plugin
code built with maven, and I would like to check whether a number of
assumptions made by maven-eclipse-plugin are still valid against modern
copies of Eclipse.

When maven-eclipse-plugin creates the .project file, entries such as the
following are created to refer to jar dependencies:

  <linkedResources>
    <link>
      <name>abbot-0.13.0.jar</name>
      <type>1</type>
      <location>C:/[path]/.m2/repository/abbot/abbot/0.13.0/abbot-0.13.0.jar</location>
    </link>
    ...

When an attempt is made to build code using the eclipse IDE, the classpath
is picked up correctly, and code that depends on these linked dependencies
builds and runs correctly.

However: As soon as an attempt is made to export the plugin using the
Eclipse export plugin wizard, these linked dependencies are ignored.

The linked dependencies do not show up in the final plugin build, the log
of the plugin export process is full of java compile errors about missing
packages caused by these missing jars.

So, the question is: Does the "link" method as shown above still work in
Eclipse v3.2.x, and is maven-eclipse-plugin producing a bogus .project
file?

Regards,
Graham
--



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


Re: maven-eclipse-plugin and PDE: do dependencies work?

Posted by Adrian Herscu <bm...@fastmail.fm>.
Hi Graham,

"Upgraded" to 2.4-SNAPSHOT solved the missing .classpath issue :-)
Besides the .classpath issue, the eclipse:eclipse also does some bad 
changes to the OSGI manifest file. It tries to "guess" the right bundle 
name from the maven artifactId and version, but it gets it wrong (labels 
are not accepted in OSGI bundle versions).

I think that maven-eclipse-plugin is a small issue...
The big one is pde-maven-plugin. I have managed to make it build my 
empty eclipse feature and plugins, but now when I need to add 
dependencies to these plugins it does not add those dependencies to the 
compile classpath. Any suggestions?

Thanks,
Adrian.



Graham Leggett wrote:
> On Mon, June 11, 2007 5:45 pm, Adrian Herscu wrote:
> 
>> I have a similar problem...
>> Added a dependency to my PDE project run mvn eclipse:clean
>> eclipse:eclipse and only the .project file is generated (without those
>> linkedResources!). The .classpath file is not generated at all!!!
>>
>> Moreover, running mvn install on the project fails because the
>> dependency is not in the classpath :-(
> 
> This is a separate problem, fixed in
> http://jira.codehaus.org/browse/MECLIPSE-279.
> 
> I am trying to get the maven-eclipse-plugin to a state where it a) works
> and is b) documented, but this is turning out to be a bit of a nightmare.
> 
> Regards,
> Graham
> --


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


Re: maven-eclipse-plugin and PDE: do dependencies work?

Posted by Graham Leggett <mi...@sharp.fm>.
Tom Huybrechts wrote:

> Generating PDE projects is much different from  ordinary projects. PDE
> handles the classpath and interproject dependencies itself. Maven
> should never generate these, and certainly not try to link to a jar in
> the local repository. For external dependencies, you should think
> about setting up a target platform. There are a number of Maven
> plugins to be found to build PDE-based projects with Maven, and to
> create a target platform.

Despite a number of plugins being available, there is still not a 
authoritative configuration for building plugins and products for 
eclipse with maven that is repeatable.

I have started with maven-eclipse-plugin, and have slowly worked towards 
getting it to play nicely with the pde-maven-plugin, with the final goal 
  of getting a configuration to work out the box.

One showstopper in maven-eclipse-plugin has been found and fixed. A 
second problem has been identified: the "linked resources" feature of 
eclipse, used by maven-eclipse-plugin, doesn't currently work during PDE 
builds. I am busy testing a workaround provided by the 
maven-dependency-plugin that may be a stopgap until eclipse is fixed.

After that, it's on to lift some of the limitations in the pde-maven-plugin.

Regards,
Graham
--

Re: maven-eclipse-plugin and PDE: do dependencies work?

Posted by Tom Huybrechts <to...@gmail.com>.
On 6/11/07, Graham Leggett <mi...@sharp.fm> wrote:
> On Mon, June 11, 2007 5:45 pm, Adrian Herscu wrote:
>
> > I have a similar problem...
> > Added a dependency to my PDE project run mvn eclipse:clean
> > eclipse:eclipse and only the .project file is generated (without those
> > linkedResources!). The .classpath file is not generated at all!!!
> >
> > Moreover, running mvn install on the project fails because the
> > dependency is not in the classpath :-(
>
> This is a separate problem, fixed in
> http://jira.codehaus.org/browse/MECLIPSE-279.
>
> I am trying to get the maven-eclipse-plugin to a state where it a) works
> and is b) documented, but this is turning out to be a bit of a nightmare.
>
> Regards,
> Graham
> --

Generating PDE projects is much different from  ordinary projects. PDE
handles the classpath and interproject dependencies itself. Maven
should never generate these, and certainly not try to link to a jar in
the local repository. For external dependencies, you should think
about setting up a target platform. There are a number of Maven
plugins to be found to build PDE-based projects with Maven, and to
create a target platform.



>
>
>
> ---------------------------------------------------------------------
> 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: maven-eclipse-plugin and PDE: do dependencies work?

Posted by Graham Leggett <mi...@sharp.fm>.
On Mon, June 11, 2007 5:45 pm, Adrian Herscu wrote:

> I have a similar problem...
> Added a dependency to my PDE project run mvn eclipse:clean
> eclipse:eclipse and only the .project file is generated (without those
> linkedResources!). The .classpath file is not generated at all!!!
>
> Moreover, running mvn install on the project fails because the
> dependency is not in the classpath :-(

This is a separate problem, fixed in
http://jira.codehaus.org/browse/MECLIPSE-279.

I am trying to get the maven-eclipse-plugin to a state where it a) works
and is b) documented, but this is turning out to be a bit of a nightmare.

Regards,
Graham
--



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


Re: maven-eclipse-plugin and PDE: do dependencies work?

Posted by Adrian Herscu <bm...@fastmail.fm>.
Hi,

I have a similar problem...
Added a dependency to my PDE project run mvn eclipse:clean 
eclipse:eclipse and only the .project file is generated (without those 
linkedResources!). The .classpath file is not generated at all!!!

Moreover, running mvn install on the project fails because the 
dependency is not in the classpath :-(

Adrian.

Graham Leggett wrote:
> Hi all,
> 
> I have been having an interesting time trying to get some eclipse plugin
> code built with maven, and I would like to check whether a number of
> assumptions made by maven-eclipse-plugin are still valid against modern
> copies of Eclipse.
> 
> When maven-eclipse-plugin creates the .project file, entries such as the
> following are created to refer to jar dependencies:
> 
>   <linkedResources>
>     <link>
>       <name>abbot-0.13.0.jar</name>
>       <type>1</type>
>       <location>C:/[path]/.m2/repository/abbot/abbot/0.13.0/abbot-0.13.0.jar</location>
>     </link>
>     ...
> 
> When an attempt is made to build code using the eclipse IDE, the classpath
> is picked up correctly, and code that depends on these linked dependencies
> builds and runs correctly.
> 
> However: As soon as an attempt is made to export the plugin using the
> Eclipse export plugin wizard, these linked dependencies are ignored.
> 
> The linked dependencies do not show up in the final plugin build, the log
> of the plugin export process is full of java compile errors about missing
> packages caused by these missing jars.
> 
> So, the question is: Does the "link" method as shown above still work in
> Eclipse v3.2.x, and is maven-eclipse-plugin producing a bogus .project
> file?
> 
> Regards,
> Graham
> --


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