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

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
主站蜘蛛池模板: 图片| 安多县| 双牌县| 四子王旗| 克什克腾旗| 北京市| 喀什市| 墨江| 万山特区| 平邑县| 南靖县| 武宁县| 神池县| 巨鹿县| 玉林市| 建阳市| 曲水县| 沭阳县| 天峨县| 谷城县| 蓬溪县| 阳城县| 柳州市| 西和县| 水城县| 青海省| 磐石市| 台南县| 沧州市| 镇江市| 南溪县| 石河子市| 颍上县| 和林格尔县| 内黄县| 额敏县| 固阳县| 宝应县| 石渠县| 正宁县| 定兴县|