如何在 war 部署后自动启动浏览器?

How to launch browser automatically after war deployment?

我有一个 war maven 项目,我希望当我在服务器上部署它时,默认浏览器(在我的例子中是 Mozilla)会自动启动,默认 url 用于访问主页。 当然,对于 JBoss EAP6,我只需 运行 Maven 命令 clean install jboss-as:deploy 生成 war 文件并将其部署到服务器上。

我是否必须向 pom.xml 添加某些内容或在 Eclipse 中进行任何配置?

使用maven的exec插件。更多信息 here.

我用过它,效果很好,但仅适用于 maven 阶段:安装但部署没有:

<plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
        <executions>
                <execution>
                    <id>Run URL in system browser.</id>
                    <phase>install</phase>
                    <configuration>
                        <target>
                            <exec executable="start" vmlauncher="false">
                                <arg line="http://localhost:8080/mywarApp" />
                            </exec>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
        </executions>
</plugin>

我使用 eclipse 并为目标 "clean install jboss-as:deploy" 制作了 运行 配置。当点击进入时,一旦安装阶段 运行ing 浏览器也在 运行ing 但我希望它会在部署阶段结束时发生 运行ing ,你有吗任何想法