Home > Java > javaTutorial > body text

Detailed explanation of the example method of installing local jar package into maven warehouse

零下一度
Release: 2017-06-17 14:02:38
Original
1535 people have browsed it

The following editor will bring you an article to install the local jar package into the maven warehouse (implementation method). The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor and take a look.

Pom.xmldependency writing method in the actual project:


 <dependency> 
  <groupId>org.springframework</groupId> 
  <artifactId>spring-context-support</artifactId> 
  <version>3.1.0.RELEASE</version> 
</dependency>
Copy after login

The Maven command to install the JAR package is:


mvn install:install-file  
-Dfile=jar包的位置  
-DgroupId=上面的groupId  
-DartifactId=上面的artifactId  
-Dversion=上面的version  
-Dpackaging=jar
Copy after login

For example, my spring-context The -support-3.1.0.RELEASE.jar file is placed in "D:\mvn\"

The command is (executed in cmd):

mvn install:install-file -Dfile=D:\mvn\spring-context-support-3.1.0.RELEASE.jar

-DgroupId=org.springframework -DartifactId=spring- context-support -Dversion=3.1.0.RELEASE -Dpackaging=jar

Note: There should be no spaces or Chinese characters in the path and name. The command should be one line and do not wrap.

The above is the detailed content of Detailed explanation of the example method of installing local jar package into maven warehouse. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template