Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Risks of setting output folders to "target" for maven projects?

It doesn't matter whether this directory is called "bin" or "target",
but it should be the same for Eclipse and Maven, says Igor Fedorenko:
https://dev.eclipse.org/mhonarc/lists/m2e-users/msg05030.html

> Are there
> specific issues or risks with having Eclipse write classes into the same
> location as the command-line build?

Yes. 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
  line.

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
at 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
    any modified file in Eclipse, nor pull any changes from the version
    control system.

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

Bruno

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



Back to the top