Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build specific module in multi-module project

Tags:

java

maven-2

I have a multi-module project.

I thought I can compile only a single module from that multi module project with this line:

mvn -amd -pl "module-name"

This does not seem to work, but only builds the specific module. Its dependencies are not compiled yet so it fails.

Any ideas how to solve that?

like image 642
Roman Avatar asked Mar 11 '26 03:03

Roman


1 Answers

Try mvn -am -pl "module-name" instead (replace -amd with -am).

The -amd flag tries to build projects that depend upon "module-name" whereas -am builds projects that "module-name" depends upon. I feel that the documentation on those flags is a little counter-intuitive, but I'm pretty sure that this will fix your problem.

like image 88
RTBarnard Avatar answered Mar 12 '26 15:03

RTBarnard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!