Re: Using files to activate Maven profiles

2017-06-06 Thread Jörg Schaible
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



Using files to activate Maven profiles

2017-06-05 Thread DariusX
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.



--
View this message in context: 
http://maven.40175.n5.nabble.com/Using-files-to-activate-Maven-profiles-tp5909557.html
Sent from the Maven - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org