what are the disadvantages of not using maven default layout?
can't we have our own custom layout with a modified POM开发者_如何学JAVA ..are there any other disadvantages other than complicated POM
I guess you mean the project directory layout:
Yes, this is entirely customizable (see the POM Reference).
Example:
<build>
<sourceDirectory>sources</sourceDirectory>
<directory>output</directory>
<outputDirectory>${project.build.directory}/compiled-classes
</outputDirectory>
</build>
This sets the source folder to sources
, the target folder to output
and the compiler output folder to output/compiled-classes
.
If you need additional source folders, you can't specify them in the <build>
element, but you can add them dynamically with the buildhelper plugin.
If you are using only well-behaved standard maven plugins, this should work as expected. However, there may be some plugins with hard-coded paths like src/main/java
and target/classes
. Your mileage may vary.
精彩评论