Some jar packages are not available in the MAVEN Central Library, so how do you use them in your project?
Suppose we need to use: Apache-ant-zip-2.3.jar
Place the jar package in the project's Lib directory, for example:
Add a reference to the jar inside the Pom.xml, for example:
<dependency>
<groupId>org.apache</groupId>
<artifactId>apache-ant-zip</artifactId>
<version>2.3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/apache-ant-zip-2.3.jar</systemPath>
</dependency>
This will allow you to use Apache-ant-zip-2.3.jar in your project!
Here's the question of how to include Apache-ant-zip-2.3.jar in a project when it's packaged into a war.
In fact, in the pom.xml inside a configuration can be, for example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warName>${project.artifactId}</warName>
<webResources>
<resource>
<directory>lib/</directory>
<targetPath>WEB-INF/lib</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
Of course, in the include, you can also package other files, such as xml,properties and other configuration files.
After packing, I found that Apache-ant-zip-2.3.jar was already in the war package.
Done!
A pot of wine between flowers, alone without a blind date.
A toast to the moon, the shadow into three people.
Wood elder brother's articles are based on their own practice, you can pass: "E-Mail protected " contact.
How Maven packs a local dependency package