2
那么我正在研究一个公司的POM Maven结构。我想要一个像下面的例子一样的结构。现在我有两个问题!公司Maven POM嵌套结构
- 这是可能的项目调用父pom? (考虑到 它们都安装在本地Maven存储库中)。
- 如果我向公司POM添加一个许可证块,是否必须将 项目POM添加一个新的许可证块?
欢迎各位反馈意见,建议等。先谢谢你!
公司
公司POM
包含组织信息,而不是太多。
<groupId>org.company</groupId>
<artifactId>company</artifactId>
<version>1</version>
<modules>
<module>company-parent</module>
</modules>
Company父POM
定义所有的项目基本依赖/插件(管理)。
<parent>
<groupId>org.company</groupId>
<artifactId>company</artifactId>
<version>1</version>
</parent>
<artifactId>company-parent</artifactId>
项目
项目POM
基于项目的组织信息(开发人员等)。
<parent>
<groupId>org.company</groupId>
<artifactId>company-parent</artifactId>
<version>1</version>
</parent>
<groupId>org.company.project</groupId>
<artifactId>project</artifactId>
<version>1.0</version>
<modules>
<module>project-parent</module>
</modules>
项目父POM
定义为当前项目中使用的依赖/插件(管理)。
<parent>
<groupId>org.company.project</groupId>
<artifactId>project</artifactId>
<version>1.0</version>
</parent>
<artifactId>project-parent</artifactId>
<modules>
<module>company-module-1</module>
<module>company-module-2</module>
<module>company-module-3</module>
</modules>
工程模块POM的
与每一个他自己打造专业化,依赖性和东西模块。
模块1
<parent>
<groupId>org.company.project</groupId>
<artifactId>project-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>project-module-1</artifactId>
模块2
<parent>
<groupId>org.company.project</groupId>
<artifactId>project-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>project-module-2</artifactId>
模块3
<parent>
<groupId>org.company.project</groupId>
<artifactId>project-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>project-module-3</artifactId>