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 <[email protected]> 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: [email protected] > For additional commands, e-mail: [email protected] > >
