Sunday, March 25, 2007

Customize Maven Source Directory

I'm taking over a project that is ant based. The source directory is in this format: ROOT/src/java/com/...
The standard maven source directory should be in this format: ROOT/src/main/java/com/... (see maven doc).
Without change the physical file structure, a quick way to customize maven source directory is to update "build" tag in pom.xml (see maven doc).

<sourcedirectory> src/java </sourcedirectory>


Josh Davis said...

The name of the XML element should be "sourceDirectory", not "sourcedirectory".

Guziy Alexander (Huziy Oleksandr) or just Sasha:) said...

Nice, thanks))