[Maven]为工程添加非Maven工程的Jar包依赖

来源:互联网 发布:世界图书出版社 知乎 编辑:程序博客网 时间:2024/04/30 15:12
   使用Maven开发dashboard,发现report.jar不是用Maven开发的,怎么用Maven依赖report.jar呢?

命令如下:

mvn install:install-file -DgroupId=<your_group_name> -DartifactId=<your_artifact_name> -Dversion=<snapshot> -Dfile=<path_to_your_jar_file> -Dpackaging=jar -DgeneratePom=true



示例:

mvn install:install-file -DgroupId=com.bupt.liutong -DartifactId=report-Dversion=1.0 -Dfile=e:/report.jar -Dpackaging=jar -DgeneratePom=true



执行成功后,
在pom.xml文件中添加:

<dependency>
    
<groupId>com.bupt.liutong</groupId>
    
<artifactId>report</artifactId>
    
<version>1.0</version>
</dependency>

 

原文链接地址:http://www.blogjava.net/fireflyk/archive/2011/09/14/358596.html

原创粉丝点击