maven安装lib文件夹的快速方法
有没有一种更快的方法来安装maven,比如说一个完整的lib文件夹到maven依赖项,而不是每个jar的单独命令:
mvn install:install-file -DgroupId=third-party -DartifactId=app-eventinfo -Dversion=1.0 -Dpackaging=jar -Dfile=EventInfoToOrder.jar
有没有一种方法我可以说这是一个依赖项文件夹或者在eclipse中我欺骗maven的一个小解决方案使用用户定义的库作为依赖项。
是的,我的构建路径上有很多文件夹,我必须将它们安装到本地存储库中。
为阅读干杯:)
is there a quicker way to maven install say a complete lib folder to maven dependencies rather than the individual command for each jar:
mvn install:install-file -DgroupId=third-party -DartifactId=app-eventinfo -Dversion=1.0 -Dpackaging=jar -Dfile=EventInfoToOrder.jar
Is there a way I can say this is a folder of dependencies or a little work around in eclipse where I trick maven into using a user defined library as a dependency.
Yes I have a lot of folders that have been sitting on my buildpath which I must install to my local repo.
Cheers for reading :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题不在于文件夹内容,而在于为
groupId
、artifactId
和version
指定正确的值。如果您可以接受随机值,那么您可以编写一个脏的批处理文件/shell 脚本来执行此操作。
否则,您尝试自动化此操作所花费的时间(通过为文件夹中的每个 jar 映射
groupId
、artifactId
和version
),您可以手动执行mvn install:install-file
。更好的选择是检查您的依赖项,看看哪些在 Maven 存储库中不可用,然后只安装它们。剩下的会由maven自己下载。
The problem is not about the folder contents, but specifying the correct values for
groupId
,artifactId
andversion
.If you are ok with random values for this, then you could write a dirty batch file/shell script to do this.
Otherwise, the time you spend trying to automate this (by having a mapping of
groupId
,artifactId
andversion
for each jar in your folders), you can arguably domvn install:install-file
manually.A better option would be to review your dependencies and see which are not available in maven repo and only install those. The remaining will be downloaded by maven on its own.
没有标准的方法可以做到这一点,因为这违背了 Maven 的托管(版本化)依赖关系的哲学。
There is no standard way of doing this as it would go against Maven's philosophy of managed (versioned) dependencies.