You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lester Ward <lw...@tagaudit.com> on 2003/10/07 23:12:29 UTC

Re: Override goals

On Mon, 2003-10-06 at 16:46, Lester Ward wrote:
>> I am attempting to override a plugin goal and am not able to. Maven
>> continues to execute the original goal, not my override.
>> This is in beta 10. My recollection is that all you had to do was declare
a
>> goal of the same name in your maven.xml file. Is this incorrect?

Jason van Zyl wrote:
>Which goal are you attempting to override? When goals are linked via
>prereqs there can be problems. This is a bug but can sometimes be worked
>around.

I'm actually altering the RPM plugin
(http://maven-plugins.sourceforge.net/maven-rpm-plugin/index.html). In it, I
have defined a set of goals, one for each section of the RPM. The idea was
that the plugin would put default stuff in each of the sections, but that
you could override the goal to replace that section with your own stuff. I
have a massive hack in place now using postGoals, but it is really ugly. I'd
much prefer the goal override to work.

The plugin is declared like this (basically):

   <goal name="rpm:spec-assemble" description="Gather the spec file and
write it">
      <attainGoal name="rpm:spec-header"/>
      <attainGoal name="rpm:spec-description"/>
      <attainGoal name="rpm:spec-prep"/>
      <attainGoal name="rpm:spec-build"/>
      <attainGoal name="rpm:spec-install"/>
      <attainGoal name="rpm:spec-clean"/>
      <attainGoal name="rpm:spec-pre"/>
      <attainGoal name="rpm:spec-post"/>
      <attainGoal name="rpm:spec-postun"/>
      <attainGoal name="rpm:spec-files"/>
   </goal>

   <goal name="rpm:spec-header" description="Append the header to the RPM
spec file ">
      <j:file escapeText="false" var="rpmSpec_Header"
omitXmlDeclaration="true" trim="true">Summary:  ${pom.shortDescription}
Summary:   ${pom.shortDescription}
Name:      ${pom.artifactId}
	<!-- etc... -->
      </j:file>
   </goal>

... and so on.

Maybe this belongs on the dev list and not here.

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