Sobes.tech
Junior — Middle

Из каких элементов состоит основная конфигурация в pom.xml файла?

sobes.tech AI

Answer from AI

The main configuration in a Maven project's pom.xml file usually consists of the following key elements:

  • <project> — the root element containing all configuration.
  • <modelVersion> — the POM model version, e.g., 4.0.0.
  • <groupId> — a unique identifier for the organization or group, e.g., com.example.
  • <artifactId> — the name of the project or artifact.
  • <version> — the project version.
  • <packaging> — the packaging type (jar, war, etc.), default is jar.
  • <name> — a human-readable name of the project.
  • <dependencies> — a list of project dependencies.
  • <build> — build settings, including plugins.

Example of a minimal pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>my-app</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>My Application</name>
    <dependencies>
        <!-- dependencies -->
    </dependencies>
</project>