Book Image

Mastering Apache Maven 3

Book Image

Mastering Apache Maven 3

Overview of this book

Table of Contents (16 chapters)
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Avoid overriding the default directory structure


Maven follows the design philosophy convention over configuration. Without any configuration changes, Maven assumes that the location of the source code is ${basedir}/src/main/java, the location of tests is ${basedir}/src/test/java, and the resources are available at ${basedir}/src/main/resources. Once after a successful build, Maven knows where to place the compiled classes (${basedir}/target/classes) and where to copy the final artifact (${basedir}/target/). It is possible to change this directory structure, but it's recommended not to do so. Why?

Keeping the default structure improves the readability of the project. Even a fresh developer knows where to look into if he is familiar with Maven. Also, if you have associated plugins and other Maven extensions with your project, you will be able to use them with minimal changes if you have not altered the default Maven directory structure. Most of these plugins and other extensions assume the...