java - 在 Eclipse 中的父项目之间移动 Maven 模块

标签 java eclipse maven

我有一个 Maven 多模块结构,如下所示

ParentApp1
   - childApp1
   - childApp2
   - childApp3
TestParent
   - tchild1
   - tchild2
   - tchild3

将 Maven 项目导入到 Eclipse 后,它会正确导入并为子项目创建单独的项目。我想将 tchild1 模块移动到上述结构中的 ParentApp1 父级下。拖放后,依赖关系未解决。即使我尝试在 Eclipse 中更新 Maven 项目。谁能告诉我是否可以通过拖放在项目之间移动模块?如果是,请给我任何建议或引用,否则请告诉我在 Maven 项目之间移动模块的步骤

最佳答案

您需要在父级(ParentApp1)的pom.xml中添加项目,并在tchild1 pom.xml上更改父级

ParentApp1 pom.xml <modules> <module>tchild1</module> </modules>

TChild1 pom.xml <parent> <artifactId>ParentApp1</artifactId> <groupId>...</groupId> <version>...</version> </parent>

关于java - 在 Eclipse 中的父项目之间移动 Maven 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32984594/

相关文章:

java - 匹配除字母数字以外的 ASCII 字符

java - 形成pojo来解析JSON

java - 如何安装带有依赖项的eclipse插件(自行开发)?

eclipse - Eclipse 中 Goclipse 配置错误

eclipse - 每次重启时如何阻止 Eclipse 累积 Tomcat 实例?

eclipse - apachecamelcamel-blueprint与eclipse中的camel-cxf冲突

java - 使用 Java 中的组合和接口(interface)进行设计

java - double 到 int 和 double 到 int

java - Spring Boot 应用程序在 IDE 中运行时工作,但当部署为 war 文件时,请求失败并出现 500 错误

Java runtime.exec() 使用线程池运行多个进程