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

前端 未结 6 2091
你的背包
你的背包 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 16:58

    I had the same problem I added maven in my global tool configuration but not worked. the reason is my instance is a enter image description herenewly created one. I installed maven after that it worked.

    0 讨论(0)
  • 2021-01-31 17:07

    I had the same problem on colab and i installed mav in Jenkins Server and issue was fixed.

    !sudo apt install maven
    
    import imagej;
    ij = imagej.init(); 
    print(ij.getVersion())
    
    0 讨论(0)
  • 2021-01-31 17:13

    If you are just looking for simplest solution then you should go to global jenkins configuration

    http://localhost:32773/configureTools/
    

    And configure maven like that

    Then you have to go to your project. Inside settings you have build. Chose maven which you have created a minute ago.

    0 讨论(0)
  • 2021-01-31 17:14

    After configured Maven in globally Created Build a maven2/3 project job instead of Build a free-style software project and post build sonar works fine!

    0 讨论(0)
  • 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.
    0 讨论(0)
  • 2021-01-31 17:20

    I had the same problem and i installed maven in Jenkins Server and issue was fixed.

    sudo yum install maven
    
    0 讨论(0)
提交回复
热议问题