You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kai Hackemesser <ka...@gmail.com> on 2012/02/24 00:25:53 UTC
maven antrun plugin 1.7 ignores second execution
Hello,
I have problems getting my second antrun target to run.
Below is the plugin configuration I use. Its purpose is to start an Apache
httpd server before integration tests and kill it later. The executables
and folders are set profile and os specific. The first execution I can see
in the maven log, and in target/antrun there is a build-main.xml created
that matches the target of the first execution. However the second
execution never appears in the log nor is a file created for it. What am I
missing here?
Cheers,
Kai
http://pastebin.com/JhpA0vaY
1. <plugin>
2. <artifactId>maven-antrun-plugin</artifactId>
3. <version>1.7</version>
4. <executions>
5. <execution>
6. <id>Starting Apache</id>
7. <phase>pre-integration-test</phase>
8. <goals>
9. <goal>run</goal>
10. </goals>
11. <configuration>
12. <target name="Starting Apache">
13. <echo>Starting Apache httpd:</echo>
14. <exec executable=
"${apache.home}/${apache.executable}" spawn="true">
15. <arg value="-f" />
16. <arg value=
"${project.build.directory}/httpd.conf" />
17. </exec>
18. </target>
19. </configuration>
20. </execution>
21. <execution>
22. <id>Stopping Apache</id>
23. <phase>post-integration-test</phase>
24. <goals>
25. <goal>run</goal>
26. </goals>
27. <configuration>
28. <target name="Stopping Apache">
29. <echo>Stopping Apache httpd:</echo>
30. <loadfile property="PID" srcFile=
"${project.build.directory}/httpd.pid" />
31. <exec executable="${kill.executable}"
failonerror="true">
32. <arg value="${kill.arguments}" />
33. <arg value="${PID}" />
34. </exec>
35. </target>
36. </configuration>
37. </execution>
38. </executions>
39. </plugin>
*
*
Re: maven antrun plugin 1.7 ignores second execution
Posted by Wayne Fay <wa...@gmail.com>.
I heard back from Kai over the weekend and wanted to make sure this
made it back to the list for future Google and Nabble searchers...
######
Ok, tested it now, was absolutely my fault. If I want the
post-integration-test phase to run it is not sufficient to call 'mvn
integration-test', use 'mvn verify' instead.
Cheers,
Kai
######
On Fri, Feb 24, 2012 at 6:56 PM, Kai Hackemesser
<ka...@gmail.com> wrote:
> mvn integration-test.
> Wait. I think I got it. Will try Monday at work.
>
> Cheers,
> Kai
>
> 2012/2/25 Wayne Fay <wa...@gmail.com>
>
>> > that matches the target of the first execution. However the second
>> > execution never appears in the log nor is a file created for it. What am
>> I
>> ...
>> > 5. <execution>
>> > 6. <id>Starting Apache</id>
>> > 7. <phase>pre-integration-test</phase>
>> ...
>> > 21. <execution>
>> > 22. <id>Stopping Apache</id>
>> > 23. <phase>post-integration-test</phase>
>>
>> What command are you executing? "mvn ..."
>>
>> PS Here's a hint into why this probably isn't working... review the
>> lifecycle:
>>
>> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
>>
>> Wayne
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: maven antrun plugin 1.7 ignores second execution
Posted by Kai Hackemesser <ka...@gmail.com>.
mvn integration-test.
Wait. I think I got it. Will try Monday at work.
Cheers,
Kai
2012/2/25 Wayne Fay <wa...@gmail.com>
> > that matches the target of the first execution. However the second
> > execution never appears in the log nor is a file created for it. What am
> I
> ...
> > 5. <execution>
> > 6. <id>Starting Apache</id>
> > 7. <phase>pre-integration-test</phase>
> ...
> > 21. <execution>
> > 22. <id>Stopping Apache</id>
> > 23. <phase>post-integration-test</phase>
>
> What command are you executing? "mvn ..."
>
> PS Here's a hint into why this probably isn't working... review the
> lifecycle:
>
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
>
> Wayne
>
Re: maven antrun plugin 1.7 ignores second execution
Posted by Wayne Fay <wa...@gmail.com>.
> that matches the target of the first execution. However the second
> execution never appears in the log nor is a file created for it. What am I
...
> 5. <execution>
> 6. <id>Starting Apache</id>
> 7. <phase>pre-integration-test</phase>
...
> 21. <execution>
> 22. <id>Stopping Apache</id>
> 23. <phase>post-integration-test</phase>
What command are you executing? "mvn ..."
PS Here's a hint into why this probably isn't working... review the lifecycle:
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
Wayne