EN
Docker + Linux - Maven failed to build the project, spotify docker ProcessingException: java.io.IOException: No such file or directory
1 answers
3 points
I try to build my maven project, but got an error.
mvn cmd I use to build:
xxxxxxxxxx
1
mvn clean install -Dmaven.test.skip=true
Docker version on my linux (CentOS distribution):
xxxxxxxxxx
1
[root@localhost]# docker -v
2
Docker version 19.03.13, build 4484c46d9d
Error short:
xxxxxxxxxx
1
java.util.concurrent.ExecutionException:
2
com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException:
3
java.io.IOException: No such file or directory -> [Help 1]
Error from maven:
xxxxxxxxxx
1
[root@localhost]# mvn clean install -Dmaven.test.skip=true
2
3
.......
4
5
INFO: I/O exception (java.io.IOException) caught when processing request to
6
{}->unix://localhost:80: No such file or directory
7
Sep 29, 2020 3:57:27 AM
8
com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec execute
9
INFO: Retrying request to {}->unix://localhost:80
10
[WARNING] An attempt failed, will retry 1 more times
11
org.apache.maven.plugin.MojoExecutionException: Could not build image
12
at com.spotify.plugin.dockerfile.BuildMojo.buildImage(BuildMojo.java:208)
13
at com.spotify.plugin.dockerfile.BuildMojo.execute(BuildMojo.java:110)
14
15
.......
16
17
[INFO] ------------------------------------------------------------------------
18
[INFO] BUILD FAILURE
19
[INFO] ------------------------------------------------------------------------
20
[INFO] Total time: 5.320s
21
[INFO] Finished at: Tue Sep 29 03:57:28 EDT 2020
22
[INFO] Final Memory: 47M/603M
23
[INFO] ------------------------------------------------------------------------
24
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.9:build
25
(default) on project data-mock-gen: Could not build image:
26
java.util.concurrent.ExecutionException:
27
com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException:
28
java.io.IOException: No such file or directory -> [Help 1]
29
[ERROR]
30
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
31
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
32
[ERROR]
33
[ERROR] For more information about the errors and possible solutions,
34
please read the following articles:
35
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
How to fix it?
1 answer
6 points
Fix:
xxxxxxxxxx
1
[root@localhost]# export DOCKER_HOST=unix:///var/run/docker.sock
Restart docker:
xxxxxxxxxx
1
[root@localhost]# service docker restart
2
Redirecting to /bin/systemctl restart docker.service
Run mvn:
xxxxxxxxxx
1
[root@localhost]# mvn clean install -Dmaven.test.skip=true
2
3
.....
4
5
[INFO] ------------------------------------------------------------------------
6
[INFO] BUILD SUCCESS
7
[INFO] ------------------------------------------------------------------------
8
[INFO] Total time: 11.117s
9
[INFO] Finished at: Tue Sep 29 04:06:44 EDT 2020
10
[INFO] Final Memory: 50M/633M
11
[INFO] ------------------------------------------------------------------------
See also:
0 commentsShow commentsAdd comment