0

I am using the Eclipse plugin "m2e" to compile and generate the source for the my project. But when I do modification to the code and try use "Maven clean" before recompiling it says "Building successfully" but the generated source still exit. Also, after "Maven clean", if I do "Maven build" I get errors and have to restart Eclipse in order to build the project. Any idea why how to fix "Maven clean" such that will work ok?

Calin Andrei
  • 186
  • 2
  • 5

2 Answers2

2

It looks like you have some generated source. Maven clean only deletes the target folder. If you need it to clean other folders/files, you need to define maven clean plugin in your pom and configure it suitably.

Raghuram
  • 51,854
  • 11
  • 110
  • 122
0

Are you on Linux or Mac OS X? Note that another process (e.g. a shell) may have the directory with the generated sources as its current directory. Then deleting the directory from another process will work, but the same process will still see this "stale" directory as its current directory. This will change as soon as you change the current directory to a parent directory.

EDIT: On Windows, a process having a directory as its current directory or accessing any of it's members will prevent any other process from removing that directory. So it seems that Eclipse is somehow accessing the target directory.

Christian Schlichtherle
  • 3,125
  • 1
  • 23
  • 47