Home >Java >javaTutorial >How to install local jar package into maven repository

How to install local jar package into maven repository

怪我咯
怪我咯Original
2017-06-25 10:13:131945browse

Pom.xml dependency writing method in the actual project:

 

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

The command for Maven to install the JAR package is:

 

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

For example, my spring-context-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 is on one line, do not wrap the line.

The above is the detailed content of How to install local jar package into maven repository. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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