gpt4 book ai didi

java - Dockerizing 使用 oracle-ojdbc : How do you get the driver in there? 的 Maven 应用程序

转载 作者:搜寻专家 更新时间:2023-11-01 03:34:20 24 4
gpt4 key购买 nike

我是一个没有经验的 docker 用户,我正在尝试使用 Oracle 对我的 maven web 应用程序进行 docker 化。当我尝试使用我的 maven 图像构建时,它失败说:“Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in central”,这是预期的,因为我没有在任何地方包含驱动程序。

我的问题是如何让 docker 知道驱动程序的位置,从而能够构建应用程序?谢谢

最佳答案

When I try to build using my maven image it fails saying: "Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in central" which is expected since I have not included the driver anywhere.

您需要在您的 Dockerfile 中重现与在您的主机(没有 docker)上工作的设置相同的设置(相同的 M2_HOME,无 m2/存储库设置)

您可以从 maven image 开始您的 Dockerfile ,或者,作为 in this Dockerfile ,从 jdk 镜像,自己安装 maven,然后像在主机上一样部署缺少的 jar。

关于java - Dockerizing 使用 oracle-ojdbc : How do you get the driver in there? 的 Maven 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35905590/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com