How to activate maven profile from command line (to build subsystem)

喜你入骨 提交于 2019-12-05 21:26:48

your problem is that by declaring

<modules>
    <module>MavenModule1</module>
    <module>MavenModule2</module>
</modules>

Those are always built. Just delete your first 4 lines and it will work as expected.

Now you can build MavenModule1 by typing:

-P p1

Both by typing:

-P p1,p2

and so forth.

You don't need profiles to build specific module, use -pl flag instead.

http://books.sonatype.com/mvnref-book/reference/_using_advanced_reactor_options.html

You should remove that space and it should work fine.

use

mvn package -Pp1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!