Following the below steps:
mvn install:install-file
-DgroupId= Package Name
-DartifactId=Project Name
-Dversion=Version
-Dpackaging=jar
-Dfile=jar JAR path
Take pinyin4j-2.5.0 as an example:
1、Put pinyin4j-2.5.0.jar into “D:\JAR_LIB”, the directory can be placed anywhere you like.
2、Execute the following command:
mvn install:install-file -Dfile=D:\JAR_LIB\pinyin4j-2.5.0.jar -DgroupId=net.sourceforge.pinyin4j -DartifactId=pinyin4j -Dversion=2.5.0 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
Then pinyin4j-2.5.0.jar should be involved into local repository.
3.The last step is to specify in pom.xml:
<dependency> <groupId>net.sourceforge.pinyin4j</groupId> <artifactId>pinyin4j</artifactId> <version>2.5.0</version> </dependency>