简体   繁体   English

使用一个pom.xml为两个或多个项目安装Maven

[英]Install Maven for two or more projects with one pom.xml

I'm new to maven.. 我是Maven的新手。

I have three different projects in the same workspace and I want to install Maven in the three projects with only one pom.xml in order to avoid doing it one at a time and manually, just run the maven install in Project 1 and automatically have installed maven in the other two projects. 我在同一个工作区中有三个不同的项目,并且我想在三个项目中仅使用一个pom.xml来安装Maven,以避免一次又一次手动执行,只需在Project 1中运行maven install并自动安装其他两个项目中的Maven。

I don't know if there's a maven plugin that do this task? 我不知道是否有执行此任务的Maven插件?

Anyone has good solution for this, a really need help with this! 任何人都有很好的解决方案,对此确实需要帮助!

Regards 问候

创建一个多模块项目: Maven聚合

You could create a multi-module project. 您可以创建一个多模块项目。 Here is the quickest way for me to do it with Idea: How to create an empty multi module Maven project? 这是我使用“想法: 如何创建一个空的多模块Maven项目”的最快方法

Maven is designed for a pom.xml for each project. Maven是为每个项目的pom.xml设计的。 You can save time by having a multi module Pom pointing to all three modules so you can use maven install there. 您可以通过将多模块Pom指向所有三个模块来节省时间,以便在那里使用maven安装。 The easiest for a workspace with multiple projects is to have it at the root of the workspace. 对于具有多个项目的工作空间,最简单的方法是将其放在工作空间的根目录。

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

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