- Java 9 Programming By Example
- Peter Verhas
- 177字
- 2021-07-02 23:37:37
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
推薦閱讀
- Kubernetes實(shí)戰(zhàn)
- The React Workshop
- Android NDK Beginner’s Guide
- Lua程序設(shè)計(jì)(第4版)
- Hands-On GUI Programming with C++ and Qt5
- Learning Modular Java Programming
- Visual Basic程序設(shè)計(jì)習(xí)題與上機(jī)實(shí)踐
- 代替VBA!用Python輕松實(shí)現(xiàn)Excel編程
- Troubleshooting Citrix XenApp?
- Bootstrap for Rails
- Getting Started with Python
- Sails.js Essentials
- 深入淺出 HTTPS:從原理到實(shí)戰(zhàn)
- Android應(yīng)用開發(fā)攻略
- 軟件工程實(shí)用教程 (第3版)