Maven Integration for Eclipse

[mng] maven install from runAs menu from the Eclipse giving an Exception while mvn install from command line functions without any problem

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: dev
  • Fix Version/s: None
  • Component/s: Maven Embedder
  • Labels:
    None
  • Environment:
    Eclipse Ganymede, JDK5, m2eclipse (from SVN trunk), jbosstools (from SVN trunk)
  • Number of attachments :
    1

Description

I am trying to make it work a Jboss Seam, Maven, m2eclipse, jboss tools project to work in eclipse...

With the colleagues from JBoss Tools, we made lots of progress but we are having one final problem and I think it has to do with m2eclipse.

When I am running against Ear Project in eclipse a maven install(from RunAs), I am getting the following exception but if I execute mvn install from the commandline there is no problem...

One interesting side effect both environments are creating different application.xml (maven-ear-project was configured to create the application.xml dynamically only to get the difference otherwise application.xml is in src/main/application)...

So if I execute mvn install from command line I got this in application xml...

<module>
<web>
<web-uri>burnout-web-1.0-SNAPSHOT.war</web-uri>
<context-root>burnout-web</context-root>
</web>
</module>

but if I build from eclipse with run - maven - install, I got this

<module>
<web>
<web-uri>classes</web-uri>
<context-root>/burnout</context-root>
</web>
</module>

this is astonishingly similar to exception 'Cannot copy a directory: C:\DEV\wss\runtimejbt_configuration\burnout-web\target\classes; Did you package/install org.lotr.agile.burnout:burnout-web:war:1.0-SNAPSHOT:compile?'

Any ideas...

Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot copy a directory: C:\DEV\wss\runtimejbt_configuration\burnout-web\target\classes; Did you package/install org.lotr.agile.burnout:burnout-web:war:1.0-SNAPSHOT:compile?
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot copy a directory: C:\DEV\wss\runtimejbt_configuration\burnout-web\target\classes; Did you package/install org.lotr.agile.burnout:burnout-web:war:1.0-SNAPSHOT:compile?
at org.apache.maven.plugin.ear.EarMojo.execute(EarMojo.java:200)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more

Activity

Hide
Dirk Pitt added a comment -

Sample project that is demonstrating the problem

Show
Dirk Pitt added a comment - Sample project that is demonstrating the problem
Hide
Dirk Pitt added a comment -

If you are interested with the start of discussion you can look this bug in JBoss Tools JIRA

https://jira.jboss.org/jira/browse/JBIDE-3456

Show
Dirk Pitt added a comment - If you are interested with the start of discussion you can look this bug in JBoss Tools JIRA https://jira.jboss.org/jira/browse/JBIDE-3456
Hide
Eugene Kuleshov added a comment -
Show
Eugene Kuleshov added a comment - Dirk, these FAQ entries [1], [2] explain why it may work in the command line but not in m2eclipse. [1] http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ#ProjectFAQ-cli [2] http://docs.codehaus.org/display/M2ECLIPSE/Project+FAQ#ProjectFAQ-WhatMavenversionisusedbyplugin
Hide
Dirk Pitt added a comment -

Thx for the tips I would furhter investigate the problem...

I forgot to mention but I am not using the maven 2.0.9 and it is configured at installed runtimes....I don't know this is a factor or not...

If you explode the archive you would see that it also contains a war and 2 ejb projects and they have no problem with RunAs-maven-install, only the ear project.....

Show
Dirk Pitt added a comment - Thx for the tips I would furhter investigate the problem... I forgot to mention but I am not using the maven 2.0.9 and it is configured at installed runtimes....I don't know this is a factor or not... If you explode the archive you would see that it also contains a war and 2 ejb projects and they have no problem with RunAs-maven-install, only the ear project.....
Hide
Will Hoover added a comment -

I'm having the same issue. Tried to use a newer maven installation (2.0.9) instead of embedded as suggested by Eugene, but I still get "Cannot copy a directory" when performing "package" using m2e (works using command line).

Show
Will Hoover added a comment - I'm having the same issue. Tried to use a newer maven installation (2.0.9) instead of embedded as suggested by Eugene, but I still get "Cannot copy a directory" when performing "package" using m2e (works using command line).
Hide
Leopoldo Muller added a comment -

I removed the flag 'Resolve Workspace artifcats' in Run configurations and it worked fine.

Show
Leopoldo Muller added a comment - I removed the flag 'Resolve Workspace artifcats' in Run configurations and it worked fine.
Hide
Riccardo Serafin added a comment -

Hi.

I have the same problem (exactly as described here, with the same workaround working), but only with the latest version of the 0.9.7 eclipse plugin (0.9.7.200902090947). When using a previous version (0.9.7.200811301806) the error was not present and everything worked fine. With this version everything works as it is supposed to work (using maven 2.0.9 instead of the embedded one). So i guess this is a regression from a previous solved problem.

Hope this will help maintainers in solving this issue, cos it is quite a show stopper.

Best,
Riccardo.

Show
Riccardo Serafin added a comment - Hi. I have the same problem (exactly as described here, with the same workaround working), but only with the latest version of the 0.9.7 eclipse plugin (0.9.7.200902090947). When using a previous version (0.9.7.200811301806) the error was not present and everything worked fine. With this version everything works as it is supposed to work (using maven 2.0.9 instead of the embedded one). So i guess this is a regression from a previous solved problem. Hope this will help maintainers in solving this issue, cos it is quite a show stopper. Best, Riccardo.
Hide
John Frey added a comment -

I also have the same exact problem. This is a show stopper for us as well.

Show
John Frey added a comment - I also have the same exact problem. This is a show stopper for us as well.

People

Vote (9)
Watch (9)

Dates

  • Created:
    Updated: