如何使用 maven build 中的 url 打开浏览器 [英] How to open a browser with a url from maven build

查看:39
本文介绍了如何使用 maven build 中的 url 打开浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Maven3 构建一个 Web 应用程序并通过 mvn jetty:run-war 运行它.现在我想在系统浏览器中从我的 Maven 构建中打开网络应用程序.

I'm building a web-application with Maven3 and run it via mvn jetty:run-war. Now I'd like to open the web-app from my maven build in the system browser.

推荐答案

我在 os windows 上解决了我的问题,这是我目前唯一的构建系统.在码头服务器启动并托管我的网络应用程序后,构建通过 antrun 进行启动调用:

I solved my problem on os windows, which is currently my only build system. After the jetty server is started and hosting my web-app the build makes a start call via antrun:

<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/rap?startup=entrypoint"/>
            </exec>
          </target>
        </configuration>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

这篇关于如何使用 maven build 中的 url 打开浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆