DEV Community

taijidude
taijidude

Posted on

2 3

You don't have to cd into the folder to build the maven project

Hello again dear reader! :-)

About two weeks ago i realized a thing about maven, which will come in handy when working on my build scripts again.

The title already says it pretty much. You don't have to cd into the project folder. You can just use the -f parameter and give maven the path to the directory to where the pom can be found.

Example:

mvn -f D:\temp\mvnfromafar\ clean install
Enter fullscreen mode Exit fullscreen mode

This is also possible but not necessary:

mvn -f D:\temp\mvnfromafar\pom.xml clean install
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay