Reputation: 4678
I installed docker inside a vm running on lubuntu 16.4. Afterwards I pulled the container jhipster/jhipster according to this tutorial. Accessing it with docker exec -it jhipster bash
works fine, also the process of creating an app via yo jhipster
. But when I want to run it using the maven wrapper via ./mvnw
, the following error occurs (after just under a second):
Downloading https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
Exception in thread "main" java.io.FileNotFoundException: /home/jhipster/.m2/wrapper/dists/apache-maven-3.3.9-bin/2609u9g41na2l7ogackmif6fj2/apache-maven-3.3.9-bin.zip.part (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:69)
at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:60)
at org.apache.maven.wrapper.Installer.createDist(Installer.java:64)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:121)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)
Inside the container seems to be no maven installed, but that is what the mvnw is for, right? Anyway, it's not possible to install maven on my own (inside the container) because of lacking su rights (sudo isn't found, su works "only from terminal").
I don't get what's wrong here... Can you help?
PS: The .m2-directory is empty.
Upvotes: 1
Views: 1504
Reputation: 56
I'm assuming you mapped your maven folder in the vm to the /home/jhipster/.m2 folder in the docker container, as as per the tutorial instructions. I found that if the vm did not already have maven installed, the ~/.m2 folder in the vm was created with root owner. Not sure how or why. As a result, the jhipster user in the docker container didn't have permission to write to the /home/jhipster/.m2 folder. You should be able to fix it by changing the owner of the folder (from within the vm) to the user you are using to run docker.
Upvotes: 4