We sometimes refer to local third-party packages in the development of MAVEN projects, for example:
<Dependency> <groupId>Org.artofsolving.jodconverter</groupId> <Artifactid>Jodconverter-core</Artifactid> <version>3.0-beta-4</version> <Scope>System</Scope> <Systempath>${project.basedir}\lib\jodconverter-core-3.0-beta-4.jar</Systempath> </Dependency>
When we make the project into a war package, it is not included in the Lib folder.
Here's how to fix it:
<plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-war-plugin</Artifactid> <version>2.2</version> <Configuration> <webresources> <Resource> <Directory>${project.basedir}/lib</Directory> <!--point to the directory that contains all of your jar packages- - <TargetPath>Web-inf/lib</TargetPath> < Where to copy these jar packages after compilation!-- </Resource> </webresources> </Configuration> </plugin>
Maven--Put the referenced local jar file into the war package