What is the use of pom.xml file in Java? [closed]

2019-03-23 08:37发布

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

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

2条回答
孤傲高冷的网名
2楼-- · 2019-03-23 08:54

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.

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

查看更多
狗以群分
3楼-- · 2019-03-23 08:58

It is not a java file. It is maven configuration file.

What is a POM?

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. Read more.

查看更多
登录 后发表回答