Hi Darius, DariusX wrote:
> On a micro-service leaning project, I have various modules that share > certain common aspects among them but not everything. For instance, 5 > modules may require Swagger-UI to be downloaded and unzipped into my > target/webapp. Some other grouping of 5 modules may require something > else. > > There no neat hierarchy "under" the parent POM, so I'm considering this > approach: > > 1. Create profiles in the parent POM to define certain aspects within the > build > 2. Activate each profile, by the presence of a specific "indicator" file > 3. In any sub-project that needs a specific feature, create the relevant > indicator file > 4. Maybe I'll have a main/maven directory, as a place to keep indicator > files > > I'm looking for thoughts of the pros and cons of this approach. I'd also > like to know if there's a more idiomatic approach. Activating profiles based on file existance is a neat solution for build variations and in the meanwhile often used in the way you're describing it above. However, you should never use profiles to manage dependencies. That's a recipe for desaster for consumers of your artifacts. Note, the file that triggers the profile exists only at build time... Cheers, Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org