Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Run As Maven Build vs. Eclipse auto build

Stephan Herrmann writes:
> I've observed many builds failing in situations that *might* have been
> caused by bad interaction between an explicit build triggered by
> "Run As ... > Maven build ..." and the Eclipse auto build.

Yes, this is well-known: m2e forces the use of the *same classes 
(target/classes and target/test-classes in the usual setup) for both maven 
Eclipse (see

Weird errors can be the consequence:
- NoSuchMethodException for access$0.
- A running program (launched from Eclipse) doesn't find its resources any
  more, because an "mvn clean install" command is being run on the command

The workaround is:
You have to be careful when running maven on the command line (outside
Eclipse or through "Run As ... > Maven build ..."). You must avoid that a
maven build inside Eclipse and a maven build outside Eclipse are running 
the same time.
This means:
  - As long as Eclipse displays "Building workspace...", don't run a maven
    build on the command line.
  - As long as a maven build on the command line is running, don't save 
    modified file in Eclipse, nor pull any changes from the version 

Of course, I too would be interested to know a better workaround than 


Bruno Haible                            Email: <bruno.haible@xxxxxxxxxx>
IBM Deutschland
Wilhelm-Fay-Straße 30-34
65936 Frankfurt am Main
IBM Deutschland Research & Development GmbH
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

Back to the top