Languages
[Edit]
EN

Maven - import local jar to project

6 points
Created by:
Root-ssh
175400

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:

  1. add this dependency to our pom.xml
  2. 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>

 

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Maven

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join