
<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>LoggingExample</groupId>
<artifactId>LoggingExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!--log4j2 dependencies-->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Notice above Maven POM file we have specific element dependencies and under this element there is list of dependency element with required elements groupId, artifactId and version.<dependency>
<groupId>myexternaldependency</groupId>
<artifactId>myexternaldependency</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\war\WEB-INF\lib\myexternaldependency.jar</systemPath>
</dependency>
<modelVersion>4.0.0</modelVersion>
<groupId>LoggingExample</groupId>
<artifactId>LoggingExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependency>
<groupId>LoggingExample</groupId>
<artifactId>LoggingExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
Labels: maven