maven - 如何配置 Maven 离线工作?完整的解决方案
问题描述
我需要配置 maven 以将依赖项下载到我的项目中的目录,以便我可以将我的项目复制到另一台没有 Internet 访问权限的 PC。我找到了 -o 选项和“依赖项:复制依赖项”插件,但没有人解释以后如何使用这些依赖项。下载依赖项然后在没有 Internet 连接的 PC 上使用它的方法是什么?
解决方案
Maven caches downloaded dependencies (and plugins -- just having the project's dependencies won't necessarily be enough depending on the pom structure) in ~/.m2/repository
. If you build your project, then clone the ~/.m2/repository
directory as well as your project to another machine, you should be able to build in offline mode with all dependencies available to use.
推荐阅读
- python - str 到 int:ValueError:int() 以 10 为底的无效文字
- java - 使用加密文件并为它们提供 FileProvider
- azure - Start-OBRegistration Vault 凭据验证失败
- python - 通过变量列表更改颜色和文本时,Tkinter 标签小部件的奇怪行为
- android - FragmentDirections 不是由 Safe Args 插件生成的
- c# - WCF 服务空响应
- amazon-web-services - Golang:模拟具有相同方法名称的 AWS 服务
- javascript - 如何从文本中获取类似 img"" 的字符串
- scikit-learn - 预先计算的矩阵在集群中的 dbscan 中消耗大量内存
- python - 将sql存储在配置文件中