官术网_书友最值得收藏!

Project structure and build tools

The project this time will contain many modules. We will still use Maven in this chapter. We will set up a so-called multi-module project in Maven. In such a project, the directory contains the directories of the modules and pom.xml. There is no source code in this top-level directory. The pom.xml file in this directory serves the following two purposes:

  • It references the modules and can be used to compile, install, and deploy all the modules together
  • It defines parameters for the modules that are the same for all of them

Every pom.xml has a parent and this pom.xml is the parent of the pom.xml files in the module directories. To define the modules, the pom.xml file contains the following lines:

<project> 
...
<modules>
<module>SortInterface</module>
<module>bubble</module>
<module>quick</module>
</modules>
</project>

These are the names of the modules. These names are used as directory names and also as artifactId in the pom.xml module. The directories in this setup look as follows:

$ tree 
|-SortInterface
|---src/main/java/packt/java9/by/example/ch03
|-bubble
|---src
|-----main/java/packt/java9/by/example/ch03/bubble
|-----test/java/packt/java9/by/example/ch03/bubble
|-quick/src/
|-----main/java
|-----test/java
主站蜘蛛池模板: 浏阳市| 甘孜县| 乌拉特前旗| 桃园市| 子洲县| 重庆市| 长葛市| 兰溪市| 瑞安市| 宣化县| 化州市| 石屏县| 藁城市| 冀州市| 怀宁县| 阿图什市| 海安县| 杨浦区| 大厂| 浮山县| 永昌县| 四子王旗| 凤城市| 藁城市| 嘉峪关市| 清远市| 叙永县| 新密市| 尤溪县| 专栏| 湄潭县| 广德县| 曲靖市| 兰考县| 锡林浩特市| 乌拉特中旗| 克拉玛依市| 万源市| 嵊泗县| 日照市| 浙江省|