简体   繁体   English

了解Maven项目结构

[英]Understanding maven project structure

This is my first question and it is similar to the one here multi module maven project structure in eclipse which describes a multi-module maven project structure. 这是我的第一个问题,与eclipse中描述多模块maven项目结构的多模块maven项目结构类似。 My problem is that the "multi-module-maven-project" project node includes folder to other dependent modules within its node while those dependent modules still have their own separate nodes. 我的问题是,“ multi-module-maven-project”项目节点在其节点内包括指向其他​​从属模块的文件夹,而那些从属模块仍然具有自己的单独节点。 I often need to modify existing projects in this form but the challenge is where exactly is the best place to make changes to a project of similar structure? 我经常需要以这种形式修改现有项目,但是挑战在于,对结构相似的项目进行更改的最佳位置是哪里? In the "multi-module-maven-project" project node or in the respective dependent module's node? 在“ multi-module-maven-project”项目节点中还是在相应从属模块的节点中?

The reason for this question is because most of the modules have configuration files, packages and Spring XML files that I often need to put into consideration while making changes as I need to edit those files or create new ones eg "multi-module-maven-project" project may have a pom file while a dependent module may have its own pom file. 之所以提出这个问题,是因为大多数模块都包含配置文件,程序包和Spring XML文件,在进行更改时经常需要考虑这些配置文件,因为我需要编辑这些文件或创建新文件,例如“ multi-module-maven-项目”项目可能具有pom文件,而从属模块可能具有其自己的pom文件。 It can be confusing at times, trying to find out where the setting for a particular line of code will reside 有时可能会感到困惑,试图找出特定代码行的设置将驻留在哪里

I will appreciate all responses especially those that reflect experience in the use of camel, camel-spring, maven, osgi and fuse-esb environment 我将不胜感激,特别是那些反映出使用骆驼,骆驼弹簧,maven,osgi和fuse-esb环境的经验的响应

Its the way the eclipse render maven based project. Eclipse渲染基于Maven的项目的方式。 It generally creates two structure. 它通常创建两个结构。 One based on master pom (parent project) and others based on individual module pom. 一个基于主pom(父项目),另一个基于单个模块pom。 however doing changes in any structure will reflect in the other one. 但是,在任何结构上进行更改都会反映在另一个结构上。 As a practice I do changes in individual module folder structures and is more easy to read too. 作为一种实践,我会更改单个模块的文件夹结构,并且也更易于阅读。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM