Thanks, Stevo. That make sense. I do have the same execution ID, but I must
be doing something else wrong because both goals still run.

I have both the main and profile plugin definitions inside a
pluginManagement element in the parent POM, then just include the groupId
and artifactId in the child POM, if that makes a difference.

I'll keep playing around with it to figure out what I'm doing wrong. I'd
really like to get #2 to work, though, so I don't have so much duplication.


Stevo Slavic wrote:
> 
> If you give same id to executions, regular one and one in the profile,
> when
> profile is active it will override regular execution in its entirety
> (bound
> phase, goals, configuration, ...)
> 
> Regards,
> Stevo.
> 
> On Mon, Nov 30, 2009 at 9:08 PM, Jeff French <j...@mdbconsulting.com>
> wrote:
> 
>>
>> I have two related questions:
>>
>> 1. Can I define a profile that replaces the goal executed by a plugin,
>> rather than add to it?
>> 2. Can I override the goal invoked for a plugin without duplicating the
>> entire plugin definition within a profile?
>>
>> I'm using the assembly plugin (bound to the package phase) and a custom
>> descriptor to bundle a project's jar, startup script, etc. into a zip
>> file
>> using assembly:single. That works fine.
>>
>> During development we want to access the expanded contents of the zip
>> file.
>> For that I can add the assembly:directory-single goal. Now I have both
>> the
>> zip file and expanded directory. Rather than invoke both goals, however,
>> I'd
>> rather invoke assembly:single by default and assembly:directory-single
>> during development.
>>
>> For question #1, I've gotten partially there by creating a 'dev' profile
>> that duplicates the default assembly (goal=single), but invokes a the
>> directory-single goal. This gives me only the zip file under normal
>> situations, but both when the profile is set to 'dev'.
>>
>> For question #2, I tried using '<goal>${assembly.goal}</goal>' in my
>> plugin
>> definition, setting a default value for the 'assembly.goal' property, and
>> changing the property's value in a profile. Unfortunately, Maven then
>> gives
>> me the error:
>>
>> ....LifecycleExecutionException: '${assembly.goal}' was specified in an
>> execution, but not found in the plugin
>>
>> so it looks like the property is not expanded for the goal element.
>>
>> Thanks for any pointers.
>>
>>      Jeff
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Invoke-a-different-plugin-goal-based-on-profile-tp26580967p26580967.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
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Invoke-a-different-plugin-goal-based-on-profile-tp26580967p26582656.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

Reply via email to