Java code
mvn install:install-file
-DgroupId=package name-DartifactId=project name-Dversion=version number-Dpackaging=jar-Dfile=path where the jar file is located
Take pinyin4j-2.5.0 as an example:
1. Place the pinyin4j-2.5.0.jar file in the "D:/JAR_LIB" directory (any directory is arbitrary)
2. Execute the 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
In this way, maven imports the pinyin4j-2.5.0.jar package to the local repository and succeeds.
3.pom.xml file configuration:
Xml code
<dependency> <groupId>net.sourceforge.pinyin4j</groupId> <artifactId>pinyin4j</artifactId> <version>2.5.0</version> </dependency>
springboot introduces dependencies when packaging the project
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin< /artifactId><configuration><mainClass>com.Application</mainClass><layout>ZIP</layout></configuration><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build>
The above example of sending local jar packages to Maven's warehouse is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.