Java中pom.xml文件的用途是什么? [英] What is the use of pom.xml file in Java?

查看:4821
本文介绍了Java中pom.xml文件的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

POM文件的主要功能是什么?它为什么实际使用?

What is the main feature of a POM file and why is it actually used?

无论我们在其中提供什么,依赖关系如何映射到Java虚拟机申请变得灵活吗?

How will the dependencies get mapped to the Java virtual machine whatever we give in it and become flexible on application?

推荐答案


项目对象模型或POM是基本工作单元在
Maven。它是一个XML文件,包含有关项目
的信息以及Maven用于构建项目的配置详细信息。
包含大多数项目的默认值。这方面的例子是
构建目录,它是目标;源目录,即
src / main / java;测试源目录,即src / main / test;和
等等。

A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects. Examples for this is the build directory, which is target; the source directory, which is src/main/java; the test source directory, which is src/main/test; and so on.

POM从Maven 1中的project.xml重命名为Maven 2中的pom.xml.
而不是maven.xml文件包含可以执行
的目标,目标或插件现在在pom.xml中配置。当
执行任务或目标时,Maven在当前的
目录中查找POM。它读取POM,获取所需的配置
信息,然后执行目标。

The POM was renamed from project.xml in Maven 1 to pom.xml in Maven 2. Instead of having a maven.xml file that contains the goals that can be executed, the goals or plugins are now configured in the pom.xml. When executing a task or goal, Maven looks for the POM in the current directory. It reads the POM, gets the needed configuration information, then executes the goal.

资料来源: 官方文档

Source: Official Documentation

这篇关于Java中pom.xml文件的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆