Esben Andersen Esben Andersen - 2 months ago 7
Java Question

Change output directory for maven2

I am creating my first maven2 project and i cant find anything on this by googling.

Can you tell me how to change the default output directory away from "target"
I want to be able to name the directory myself.

when i change the build paths for the project and modules in intellij settings, the target folder is still created - although empty.
I want it gone for good please :)

Regards

Answer

I solved my problem by editing the compiler.xml in the .idea folder.

before edit:

<profile default="false" name="Maven default annotation processors profile" enabled="true">
  <sourceOutputDir name="target/generated-sources/annotations" />
  <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
  <outputRelativeToContentRoot value="true" />
  <processorPath useClasspath="true" />
  <module name="RestReactReduxES6" />
</profile>

after edit:

<profile default="false" name="Maven default annotation processors profile" enabled="true">
  <sourceOutputDir name="build" />
  <outputRelativeToContentRoot value="true" />
  <processorPath useClasspath="true" />
  <module name="RestReactReduxES6" />
</profile>

This fixed my problem. And building my problem stopped making files and folders beside my output dir "build"