Manually add the downloaded JAR package to the Maven repository

Article source: http://www.cnblogs.com/tangshengwei/p/6341628.html

Manually add the downloaded JAR package to the Maven repository

      Manually add the downloaded JAR package to the Maven repository      

Common Maven repository URLs:
http://mvnrepository.com/
http://search.maven.org/
http://repository.sonatype.org/content/groups/public/
http://people.apache.org/repo /m2-snapshot-repository/
http://people.apache.org/repo/m2-incubating-repository/

Demonstrate adding a JAR package of ojdbc-10.2.0.4.0.jar:

1.1 Log in to http://mvnrepository.com/  and enter the keyword of the JAR package you want to search in the search bar:

1.2 Select the version of the Jar package you want to download:

1.3 Download the Jar package:

Maven command to install JAR package:

copy code
Here is the Jar package information in the above picture:
 <!-- https://mvnrepository.com/artifact/ojdbc/ojdbc -->
 <!-- (parameter 1): Download to the local ojdbc-10.2.0.4. The real storage path of the 0.jar package  -->
 < dependency > 
    < groupId > ojdbc </ groupId > ----------------- (parameter two)
     < artifactId > ojdbc </ artifactId > ----------- (parameter three)
     < version > 10.2.0.4.0 </ version > ------------ (parameter four)
 </ dependency >
copy code

Use the maven command to move the jar package to the local repository of maven.

grammar:

1
mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar

 I put "ojdbc-10.2.0.4.0.jar" under "D:\Program Files\mvn\",

Note: There is a space in "Program Files", so you need to add double quotes. The other three parameters can be copied from the above. The following is the command I used to install the ojdbc-10.2.0.4.0.jar package:

1
mvn install:install-file -Dfile= "D:\Program Files\mvn\ojdbc-10.2.0.4.0.jar" -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

The following points should be noted:
1. Note that the "-" after install cannot be missing without spaces
2. Note the path of the jar package and the name of the jar package in "-Dfile".
3. Pay attention to the cmd command prompt, Check whether the jar package is successfully copied in the local repository.

Important point: Jar packages are installed under "C:\Users\Administrator\.m2\repository\" by default. In fact, the above (parameter 2, parameter 3, parameter 4) is to specify the specific installation path for installation.

( In the future, you can also change the parameters 2, 3, and 4 according to your own needs, which is actually to change the installation path ).

The ojdbc-10.2.0.4.0.jar package is installed:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325596333&siteId=291194637
Recommended