You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Farhan Sarwar <fa...@gmail.com> on 2007/08/16 22:32:43 UTC

Question relating to a build configured within a profile

Another quick questions folks..

I have got a profile (in a pom) which has a build configured for
maven-ant plugin in it (as below), now my understanding of
plugin/goals configured within a build is that if they are not bind to
phase they would just run independent of the maven build-cycle-phases,
as also stated in the maven documention (on "Guide to Configuring
Plug-ins") which says " If the goal is binded to a phase then it will
execute to that phase. But if the goal is not binded to any lifecycle
phases then it will be executed without executing any phases(as if it
was executed in the CLI)." Now what i want to achieve is to execute
the goal configured in this profile from mvn command line independent
of the build-cycle-phases, which i have not been able to.
What i have been doing so far to activate/invoke this profile is 1)
un-comment the phase tag, and 2) invoking the same by giving the phase
at the command like e.g. "mvn -P myprofile initialize" (or some other
phase later than the one specified in the configuration). I want to
call the same thing with 1) keeping the phase tag commented 2) giving
the goal name instead of phase (so that it run irrespective of
phases). I hope someone can assist me with this...

<profiles>
  <profile>
      <id>myprofile</id>
         <build>
             <plugins>
               <plugin>
                   <artifactId>maven-antrun-plugin</artifactId>
                     <executions>
                       <execution>
                         <id>execution2</id>
                         <!--phase>initialize</phase-->
                         <configuration>
                            <tasks>
                              <delete file="lib/test2.txt"/>
                            </tasks>
                          </configuration>
                          <goals>
                            <goal>run</goal>
                          </goals>
                     </execution>
                   </executions>
             </plugin>
          </plugins>
       </build>
  </profile>
</profiles>

Regards,

Farhan.

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