[prev in list] [next in list] [prev in thread] [next in thread] 

List:       maven-user
Subject:    RE: [EXTERNAL] RE: profile activation with multiple conditions
From:       Jörg Schaible <joerg.schaible () swisspost ! com>
Date:       2015-11-16 13:31:16
Message-ID: n2clr4$t54$1 () ger ! gmane ! org
[Download RAW message or body]

Hi Justin,

Justin Georgeson wrote:

> Thanks. I was hoping that it would evaluate the file-based activation per
> project. I was treating it as a separate issue than the multiple
> conditions. But I think what you're saying is that the profile activation
> happens once for the whole reactor, and not per project within the
> reactor. I gather that you're saying if the keystore file doesn't exist
> when I first run maven, then the keystore profile will be activated for
> all projects in the reactor. Is that correct?

Yes. I've verified this with 3.3.9 and 3.2.5. Fails for 3.1.1, i.e. 3.1.1 
implements OR.

> I'm still seeing the
> keystore profile activate from the property alone even if the keystore
> file already exists before I run the mvn command. So that still suggests
> that it's doing an or of the conditions rather than an and. Running 'mvn
> -N -X help:active-profiles -Djarsigner.keystore.scm.url' isn't giving any
> debug info on the profile activation unfortunately.

Keep in mind, that activation is resolved on base of the location of the 
current project's POM, i.e. if your file-based activation uses a relative 
path that is only valid from the parent POM's directory, it does not work 
for the projects inheriting that parent. E.g. a profile declared in a parent 
POM activated on existence of src/main/java will be active for any current 
project compiling Java sources for the main artifact.

> My goal here is to have as much of the build process as possible
> self-contained in the POM files and executed from a single mvn command.

Why don't you simply activate the profile based on the property only and 
declare in this profile the keystore as (provided) dependency, copying it 
with the dependency plugin somewhere to target and configure the jarsigner 
plugin to use it from that location (plugins also defined in this' profile 
settings)?

Cheers,
Jörg


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic