sous-chefs / maven

Development repository for the maven cookbook
https://supermarket.chef.io/cookbooks/maven
Apache License 2.0
36 stars 153 forks source link

Add check and informative message that maven is installed on the node #51

Closed C-h-e-r-r-y closed 7 years ago

C-h-e-r-r-y commented 9 years ago

When I try to execute a recipe like that:

maven 'spring-context' do
   group_id 'org.springframework'
   version  '4.0.4.RELEASE'
   dest     '/root'
   repositories ['http://repo.maven.apache.org/maven2/']
end

After executing from workstation:

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

I got an error:

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

Which means that maven simply has not been installed on the node.

So it needs to check that it exists and print corresponding message.

UPDATED As it tunrs out I did not include maven recipe, e.g. on the top there should be include_recipe "maven::default" none the less adding a message mvn command is not found, please check that maven is installed or check that you include maven::default recipe