简体   繁体   English

Jenkins与MVN缺少目录错误

[英]Jenkins with mvn missing dir error

I've created jenkins job which need to build something very simple 我创建了詹金斯工作,需要构建非常简单的东西

Clone this repo 克隆此仓库

https://github.com/g0t4/jenkins2-course-spring-boot https://github.com/g0t4/jenkins2-course-spring-boot

cd to project 光盘到项目

https://github.com/g0t4/jenkins2-course-spring-boot/tree/master/spring-boot-samples/spring-boot-sample-atmosphere https://github.com/g0t4/jenkins2-course-spring-boot/tree/master/spring-boot-samples/spring-boot-sample-atmosphere

and run mvn compile 并运行mvn compile

inside the atmosphere there is a pom.xml file, so what could be the reason to no finding it ? 大气中有一个pom.xml文件,那么找不到它的原因可能是什么?

I've configure the task like following 我已经配置了如下任务

在此处输入图片说明

在此处输入图片说明

The error in the log is: 日志中的错误是:

Checking out Revision 4bde91e33e2860b2aab142028c04eff37b7791f2 (refs/remotes/origin/master) 检出修订版4bde91e33e2860b2aab142028c04eff37b7791f2(引用/远程处理/来源/主文件)

git config core.sparsecheckout # timeout=10 git checkout -f 4bde91e33e2860b2aab142028c04eff37b7791f2 Commit message: "Adding in jacoco code coverage" First time build. git config core.sparsecheckout#timeout = 10 git checkout -f 4bde91e33e2860b2aab142028c04eff37b7791f2提交消息:“添加jacoco代码覆盖率”首次构建。 Skipping changelog. 跳过变更日志。 [atmo_local] $ mvn -f spring-boot-samples/spring-boot-sample-atmosphere/pom.xml complie FATAL: command execution failed java.io.IOException: error=2, No such file or directory [atmo_local] $ mvn -f spring-boot-samples / spring-boot-sample-atmosphere / pom.xml包含致命错误:命令执行失败java.io.IOException:error = 2, 没有这样的文件或目录

update 更新

When I click on my mac mvn -v I get 当我单击我的mac mvn -v我得到

Apache Maven 3.3.9 (bb52d2b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T18:41:47+02:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"

update 2 this is the global configuration 更新2,这是全局配置

在此处输入图片说明

在此处输入图片说明

I've installed the latest jenkins with maven plugin . 我已经使用maven插件安装了最新的jenkins。 this is not sufficient ? 这还不够吗?

No, it's not. 不,这不对。 You have to also configure Maven location to jenkins. 您还必须将Maven位置配置为jenkins。

The steps are something like: 步骤类似于:

  1. Click Manage Jenkins 单击管理詹金斯
  2. Click Global Tool Configuration 单击全局工具配置
  3. In the JDK section click Add JDK button, uncheck Install automatically checkbox and enter Name and JAVA_HOME values to point to right locations 在“ JDK”部分中,单击“添加JDK”按钮,取消选中“自动安装”复选框,然后输入“名称”和“ JAVA_HOME”值以指向正确的位置
  4. In the Maven section click Add Maven button, uncheck Install automatically checkbox and enter Name and MAVEN_HOME value (whatever it is in your jenkins system) 在“ Maven”部分中,单击“添加Maven”按钮,取消选中“自动安装”复选框,然后输入Name和MAVEN_HOME值(无论您的jenkins系统中是什么)
  5. Click Apply and then Save 单击“应用”,然后单击“保存”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM