EN
Maven - import local jar to project
6
points
Quick solution:
<dependency>
<groupId>com.example</groupId>
<artifactId>example-name</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/external_libs/MY_JAR_NAME.jar</systemPath>
</dependency>
We just need to:
- add this dependency to our pom.xml
- import maven dependency (reimport with intellij IDEA or run
mvn clean install
command)
Maven - included external JAR lib into WAR
In order to include external JAR library into our WAR we need to add below plugin to pom.xml:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>${project.basedir}/external_libs</directory>
<targetPath>WEB-INF/lib</targetPath>
<filtering>false</filtering>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>