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

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
主站蜘蛛池模板: 鄂托克旗| 沙雅县| 正安县| 常州市| 仁怀市| 河间市| 广安市| 临安市| 榕江县| 锡林郭勒盟| 宁陕县| 苏尼特左旗| 高唐县| 德阳市| 钟祥市| 玉山县| 漳平市| 商水县| 蒲江县| 梧州市| 彭泽县| 萍乡市| 文化| 雷州市| 闽侯县| 武陟县| 龙州县| 东辽县| 青铜峡市| 龙里县| 潍坊市| 苗栗市| 金门县| 红桥区| 泸溪县| 瑞丽市| 萍乡市| 湖北省| 三台县| 富宁县| 海原县|