Manually add the jar package to our MAVEN project.
1, first I create a Lib folder in the project root directory, the jar package is copied to the Lib folder
2. Then we configure the Pom.xml in Maven
<groupId>Org.wltea.analyzer</groupId> <Artifactid>Ikanalyzer</Artifactid> <version>2012ff_u1</version> <Scope>System</Scope> <Systempath>${project.basedir}/lib/ikanalyzer2012ff_u1.jar</Systempath>
eg. the source code I added locally
<!--NPL local so - <Dependency> <groupId>Com.netease.npl</groupId> <Artifactid>Npl</Artifactid> <version>0.0.1</version> <Scope>System</Scope> <Systempath>${project.basedir}/lib/qasystem.jar</Systempath> </Dependency> <Dependency> <groupId>Edu.stanford.nlp</groupId> <Artifactid>Nlp</Artifactid> <version>3.5.2</version> <Scope>System</Scope> <Systempath>${project.basedir}/lib/stanford-segmenter-3.5.2.jar</Systempath> </Dependency>
3, here GroupID and Artifactid and version are can be filled out, scope must be filled out as system, and systempath we now our Jar package address can be
4. Finally, we must add our jar package to the MAVEN packaging process. Because this jar is needed when the project is running, and we have to copy it in the Web-inf/lib directory
<groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-war-plugin</Artifactid> <Configuration> <webresources> <Resource> <Directory>${project.basedir}/lib</Directory> <TargetPath>Web-inf/lib</TargetPath> <filtering>False</filtering> <includes> <include>**/*.jar</include> </includes> </Resource> </webresources> </Configuration> <version>2.1.1</version>
eg I add the source code in the local
<!--load local jar package - <plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-war-plugin</Artifactid> <Configuration> <webresources> <Resource> <Directory>${project.basedir}/lib</Directory> <TargetPath>Web-inf/lib</TargetPath> <filtering>False</filtering> <includes> <include>**/*.jar</include> </includes> </Resource> </webresources> </Configuration> <version>2.1.1</version>
Maven Add local jar Package