gpt4 book ai didi

java - 如何在 Chef 节点中配置Cookbook Maven?

转载 作者:行者123 更新时间:2023-12-01 12:08:11 24 4
gpt4 key购买 nike

问题的来源很容易找到 this question 。所以我运行knife cookbook site install maven然后knife cookbook upload myCookbook --include-dependencie

但运行后

knife bootstrap 192.168.1.37 --ssh-user root --ssh-password '123456' --sudo --use-sudo-password --node-name node-with-maven-run --run-list 'recipe[myCookbook]'

我得到了

No such file or directory - mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -DgroupId=org.springframework -DartifactId=spring-context -Dversion=4.0.4.RELEASE -Dpackaging=jar  -Ddest=/tmp/chef_maven_lwrp20141212-27453-ocmoxb/spring-context-4.0.4.RELEASE.jar -DremoteRepositories=http://repo.maven.apache.org/maven2/ -Dtransitive=false

事实证明,maven根本没有安装在192.168.1.37上。如何在运行 Maven Cookbook 之前安装 Maven?

附注

很奇怪的是cookbook并没有测试自己是否安装了maven。

最佳答案

在metadata.rb 文件中包含依赖项“maven”,除了加载说明书外不会执行任何其他操作。

您还必须将 Recipe 包含在您的 Recipe 中。

类似的东西include_recipe 'maven' 位于 myCookbook 默认 Recipe 顶部即可。

关于java - 如何在 Chef 节点中配置Cookbook Maven?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27438236/

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