Maven.与“无家可归者"做什么罐子? [英] Maven. What to do with "homeless" jars?

查看:80
本文介绍了Maven.与“无家可归者"做什么罐子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些我需要包含在项目中的private.jar,但是我不希望将其安装到本地存储库中.

I have some proprietary.jar that I need to include in my project, but I don't wish to install it to the local repository.

我最初所做的是将jar放入项目的lib/文件夹中的版本控制中,然后将Maven依赖项指定为:

What I did initially was to put the jar into version control in my project's lib/ folder, and then specify the Maven dependency as:

<!-- LOCAL DEPENDENCY -->
<dependency>
    <groupId>topsecret</groupId>
    <artifactId>proprietary</artifactId>
    <version>0.0.1</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/java/proprietary.jar</systemPath>
</dependency>

但是,当我的项目成为别人的依赖时,这将成为一个大问题. Maven将无法验证此POM,因为该路径不是绝对路径.

However, this becomes a big problem when my project becomes someone else's dependency. Maven will not be able to validate this POM because the path is not absolute.

克服此问题的最佳方法是什么?

What is the best way to overcome this problem?

推荐答案

我在

I described in a previous answer how you can setup a file based repository and avoid the evil system scope when you can't use a corporate repository. Check it out.

这篇关于Maven.与“无家可归者"做什么罐子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆