Opening Browser with Web Application automatically after mvn install
Opening Browser with Web Application automatically after mvn install
Another little Trick for those developing web applications on Windows. Very often after I compile and install a web application with maven as an external tool from eclipse and I want to open the application in a browser to look at my changes and test the application. What I did was to add to a the web applications pom.xml an ant task which opens up a browser with the web application loaded in it on completion of the deploy to tomcat.
So every time I run (do this from eclipse)
mvn clean install
After this web application is installed and deployed into my already running tomcat container an IE browser pops up with the web application loaded.
<build>
<finalName>airweb</finalName><!-- finalName if of the war -->
<sourceDirectory>src/main/resources</sourceDirectory>
<plugins>
...
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
...
<execution>
<phase>post-integration-test</phase>
<id>browser</id>
<configuration>
<tasks>
<!-- open browser with homepage -->
<property name="browser" location="C:/Program Files/Internet Explorer/IEXPLORE.EXE" />
<property name="url"
value="http://localhost:8080/airweb/login.do" />
<exec executable="${browser}"
spawn="true">
<arg value="${url}" />
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
