Cannot run program “mvn” error=2, No such file or directory

前端 未结 6 2095
你的背包
你的背包 2021-01-31 16:19

I\'m doing a build on my Ubuntu 14.04 LTS but I\'m getting the following:

Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/videovixx
 &         


        
6条回答
  •  一整个雨季
    2021-01-31 17:20

    There are multiple things here.

    You either didn't select Maven version in Job configuration. Or you didn't configure Jenkins to install a Maven version. Or you expected to use locally installed Maven on the Slave, but it's not configured for jenkins user.

    Since I don't know what you've configured (or didn't configure) and what you expected to use, I can't answer directly, but I can explain how it works.

    If you want to use locally installed Maven on master/slave

    • You must have Maven locally installed
    • You must be able to launch it with jenkins user
      1. Execute sudo jenkins, and then execute mvn on your Slave to verify that jenkins user can run mvn
      2. If that fails, you need to properly install/configure Maven
    • In Job configuration, for Maven Version, you must select Default. This is the setting that uses the version that's installed locally on the node

    If you want to have Jenkins install Maven for you

    • You must go to Jenkins Global Tool Configuration, and configure a Maven version with automatic installer (from the web).
    • In Job configuration, for Maven Version, you must select that particular version that you've just configured.

提交回复
热议问题