Task 9 of LABS – JAVA – BUILD & PACKAGING

The task seems impossible to complete. It requires you to: “Please compile and package the application inside /opt/maven/my-app/ with maven on host01 server.”

The video hardly shows us how to use maven. Running “mvnw clean install” as shown in the video gives the error “-bash: mvnw: command not found”.

Running “mvn clean install” gives the error “Fatal error compiling: directory not found: /opt/maven/my-app/target/classes”

Running “mvn package” gives the error “Fatal error compiling: directory not found: /opt/maven/my-app/target/classes”

Please note that prior to trying these commands I was able to successfully install the maven tool and complete tasks 7 and 8.

Is there another command I should be trying to complete task 9?

Hello @janjohannsson
Please go through that dir using this command cd /opt/maven/my-app/
And then try to build using this sudo mvn package

just do this step cd /opt/maven/my-app/ after this “sudo mvn clean” install it will solve the question