0

I am still in a phase to create a POM.xml file. The basic is to start jetty plugin during the build life cycle. So far I have to enter

mvn package

mvn jetty:run-war

I do not want to do it manually. I prefer the way where a war file is created and jetty plugin started using the one command.

Here is my POM.xml

<plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.11.v20150529</version>
                <configuration>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <webApp>
                        <contextPath>/hellojavaworld</contextPath>           
                    </webApp>    
                    <war>c:\apache-tomcat-7.0.64\webapps\hellojavaworld.war</war>
                </configuration>
                <executions>
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <!--configuration>
                            <daemon>true</daemon>
                        </configuration-->
                    </execution>
                    <execution>
                        <id>stop-jetty</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
</plugin>

Why the jetty plugin is not started when inserted the following command?

mvn pre-integrate-test

What is the problem? The jetty plugin starts only when used the command

mvn jetty:run-war

Michal
  • 610
  • 10
  • 24
  • The excertp above is from parent pom.xml file. Is it somehow dependent? – Michal Nov 09 '15 at 13:23
  • It seems to be problem,because I tried to implement it in my child pom.xml file and it worked, but no I cannot use command mvn jetty:run-war. This seems to be strange,since the maven jetty plugin is dependent on location (multi module maven project). Any help? – Michal Nov 09 '15 at 13:38

2 Answers2

0

From parent : mvn jetty:run-war -pl module

question_maven_com
  • 2,457
  • 16
  • 21
0

Solved. The property of the jetty plugin for multimodule project si mentioned here: Multi-module Maven project and jetty:run

I had to specify the plugin and lifecycle configuration in the child pom.xml file. In the parent it was not working.

---Hellojavaworld-pom.xml (parent)
   ----app-pom.xml (child)
   ----jjav-pom.xml (child)
Community
  • 1
  • 1
Michal
  • 610
  • 10
  • 24