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

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
主站蜘蛛池模板: 阿尔山市| 秦安县| 邻水| 石棉县| 贞丰县| 安岳县| 平江县| 贵港市| 利津县| 乌拉特后旗| 大安市| 中宁县| 繁昌县| 桑日县| 梓潼县| 南靖县| 衡水市| 三亚市| 五峰| 英超| 衡山县| 高邑县| 湘乡市| 育儿| 舟山市| 昌吉市| 托克托县| 桐梓县| 溆浦县| 新平| 唐山市| 牙克石市| 永泰县| 潢川县| 浏阳市| 浠水县| 内江市| 晴隆县| 宾阳县| 万源市| 嵊泗县|