maven加载本地jar包到repository

maven加载本地jar到repository

  这是一个常见场景,此处以本地opencv jar文件导入repository为例

1.Ubuntu下

mvn install:install-file -Dfile=/opencv-2.4.11/build/bin/opencv-2411.jar -DgroupId=org.opencv -Dartif
actId=opencv -Dversion=2.4.11 -Dpackaging=jar

2.常见问题

windows下按上述操作,将报错:

 The goal you specified requires a project to execute but there is no POM in this directory(。。。), Please verify you invoked Maven from the correct directory.

这个问题与貌似与平台有关,好像特定于windows系统,反正linux无影响,win10有此问题,此时需采用参数加引号的形式完成设置。

mvn install:install-file '-Dfile=F:\00000\opencv-2411.jar' '-DgroupId=org.opencv' '-D
artifactId=opencv' '-Dversion=2.4.11' '-Dpackaging=jar'

猜你喜欢

转载自www.cnblogs.com/nyatom/p/9660816.html