Languages
[Edit]
EN

Maven dependency not included in war - fix

3 points
Created by:
Marcin
18820

In this short article we would like to show how to include external JAR library into WAR.

In order to do it we need to add maven-war-plugin to our pom.xml. If we have defined this plugin already in pom.xml then we need to check for webResources part of below xml plugin config.

<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>

See also:

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