Languages
[Edit]
EN

Maven dependency not included in war - fix

3 points
Created by:
Suzannah-Estrada
620

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:

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