最近工程中需要用到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>