Here come to a problem when I was using Maven to install a third party dependency into my local Maven repository. When the following command was fired:
mvn install:install-file -Dfile=/cygdrive/c/Users/kok.hoe.loh/workspace/ProjectA/lib/AuditUtil.jar -DgroupId=org.huahsin.eai -DartifactId=AuditUtil -Dversion=0.0.1 -Dpackaging=jar
[INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building ProjectA 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ ProjectA --- [INFO] Installing C:\cygdrive\c\Users\kok.hoe.loh\workspace\ProjectA\lib\AuditUtil.jar to C:\Users\kok.hoe.loh\.m2\repository\org\huahsin\eai\AuditUtil\0.0.1\AuditUtil-0.0.1.jar [INFO] Installing C:\Users\kok.hoe.loh\tool\Cygwin\tmp\mvninstall6980818442128433518.pom to C:\Users\kok.hoe.loh\.m2\repository\org\huahsin\eai\AuditUtil\0.0.1\AuditUtil-0.0.1.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.764s [INFO] Finished at: Tue Jul 08 18:00:24 SGT 2014 [INFO] Final Memory: 5M/76M [INFO] ------------------------------------------------------------------------The build was success but the dependency was not install in my local Maven repository. There trace information has already show me the problem but I have overlook it. Notice that the dependency was install to C:\cygdrive\c\..., which is not what I want. It seems to me -Dfile option doesn't recognize Cygwin file system.
This fix was easy, just ignore the root when dealing with -Dfile, which is /cygdrive/c for my case. Following sample shows the real work.
mvn install:install-file -Dfile=/Users/kok.hoe.loh/workspace/ProjectA/lib/AuditUtil.jar -DgroupId=org.huahsin.eai -DartifactId=AuditUtil -Dversion=0.0.1 -Dpackaging=jar
No comments:
Post a Comment