Add the jar package to the local maven repository

Add the jar package to the local maven repository

maven coordinates generally

<dependency>
    <groupId>myjar</groupId>-----------------(参数二)
    <artifactId>OrgPublic</artifactId>-----------(参数三)
    <version>1.0</version>------------(参数四)
</dependency>

Use the command add to the jar package maven repository

mvn install:install-file -Dfile=“jar package absolute path” -DgroupId=groupId jar package -DartifactId=artifaceId -Dversion=version number -Dpackaging=jar

Explain plainly

mvn install: install-file -Dfile = " parameter 1" -DgroupId = parameter 2 -DartifactId = parameter 3 -Dversion = parameter 4 -Dpackaging = jar ( note that some intermediate spaces, it is recommended to copy my then replaced )

Parameter 1: the true path of the local jar package, for example, mine is: D: /hadoop-common-3.2.0.jar

Parameter 2: groupId this value can be determined according to their needs

Parameter 3: artifactId this value, advice and jar of the same name

Parameter 4: version number, it goes without saying, to decide according to their own needs.

Illustration, the hadoop-common3.2.0-jar was added to maven repository

Path into the jar package stored in (to do so, you can not write the full path of the jar)

mvn install:instll-file -Dfile=‘hadoop-common-3.2.0.jar’ -DgroupId=org.apache.hadoop -DartifactId=hadoop-common -Dversion=3.2.0-Dpackaging=jar

发布了1 篇原创文章 · 获赞 0 · 访问量 41

Guess you like

Origin blog.csdn.net/m0_46194428/article/details/104441671