Bind antrun:run to a phase but profile it

http://maven.apache.org/guides/introduction/introduction-to-profiles.html

-D

On 3/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>
> Doesn't really work, as it doesn't execute anything if
> you configure the antrun plugin according to the docs:
>
>      <plugin>
>        <artifactId>maven-antrun-plugin</artifactId>
>        <executions>
>          <execution>
>            <phase>generate-sources</phase>
>            <configuration>
>              <tasks>
>
>                <!--
>                  Place any ant task here. You can add
> anything
>                  you can add between <target> and
> </target> in a
>                  build.xml.
>                -->
>
>              </tasks>
>            </configuration>
>            <goals>
>              <goal>run</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>
>
> However, it looks as if we can do the plugin config
> outside the <execution> tag (e.g. create a global
> plugin config which is valid across various lifecycle
> phases).
>
>      <plugin>
>        <artifactId>maven-antrun-plugin</artifactId>
>            <configuration>
>              <tasks>
>
>                <!--
>                  Place any ant task here. You can add
> anything
>                  you can add between <target> and
> </target> in a
>                  build.xml.
>                -->
>
>              </tasks>
>            </configuration>
>            <goals>
>              <goal>run</goal>
>            </goals>
>      </plugin>
>
> This way we can simply invoke mvn antrun:run and it
> executes the specified ANT tasks.
>
> However, this causes a different problem. What if an
> engineer has to invoke different ANT targets (e.g. one
> to deploy an app on an app server, one to undeploy the
> app from the app server, one to restart the app
> server)? That's not possible as there is only a global
> config which always executes the same set of ANT tasks
> when executing mvn antrun:run. Perhaps that could be
> simply resolved by specifying the ANT task on the
> command-line (e.g. mvn -Dant.task=deploy antrun:run).
> Any ideas on whether that's possible?
>
> Thanks,
> Chris
> But that means it only works if you have a single ANT
> target
>
> --- dan tran <[EMAIL PROTECTED]> wrote:
>
> > wonder it this would work
> >
> > maven antrun:run
> >
> > -D
> >
> >
> > On 3/15/06, Chris Hagmann <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > We need to execute some ANT tasks (e.g. for
> > > redeploying a server configuration) which we only
> > need
> > > to execute every so often, but which are not part
> > of
> > > the regular build lifecycle. Hence we need to
> > > configure the plugin, but cannot bind it to any of
> > the
> > > lifecycle phases of Maven 2.
> > >
> > > How can we do that?
> > >
> > > Thanks,
> > > Chris
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to