java - How to get the project base directory in a multi-module Maven project? -
we have multi-module maven project, looks this:
parent-module -> dao-module-1 -> dao-module-2 -> algorithms-module -> jaxb-module -> jaxrs-module -> webapp-module
i have code in algorithms-module needs write image webapp-module. way, end-users can point browsers url in webapp-module , retrieve image.
without hardcoding path parent-module, what's best way path parent-module? there default property in maven has value? if not, setting property in pom files solution?
i believe can use ./
@ beginning of string path if wan keep relative.
alternately, use system.getproperty("user.dir")
absolute path parent project folder.
Comments
Post a Comment