Maven向本地仓库导入官方仓库没有的jar包

最近工程中需要用到JNotify Java包,可是在Maven公共仓库中没有找到该jar文件,下面是一个补救的办法。

 

以jnotify-0.94.jar为例:

 

需要用到Maven如下命令:

mvn install:install-file  
-DgroupId=包名  
-DartifactId=项目名  
-Dversion=版本号  
-Dpackaging=jar  
-Dfile=jar文件所在路径 

执行以下命令:

mvn install:install-file -Dfile=D:\lib\jnotify-0.94.jar -DgroupId=net.contentobjects -DartifactId=jnotify -Dversion=0.94 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true

 

在pom.xml中添加如下内容:

<dependency>
            <groupId>net.contentobjects</groupId>
            <artifactId>jnotify</artifactId>
            <version>0.94</version>
            <<type>jar</type>

</dependency>

posted @ 2017-04-27 16:17  Nan丶G  阅读(4773)  评论(1编辑  收藏  举报