【问题标题】:Shutdown Dropwizard after starting it from maven for acceptance tests从 maven 启动后关闭 Dropwizard 进行验收测试
【发布时间】:2014-08-20 13:27:05
【问题描述】:

我正在开发一个多模块 Maven 项目。我们使用 dropwizard,为了执行验收测试,我们使用 maven-antrun-plugin 启动应用程序,但问题是测试完成后应用程序不会停止,然后我必须从任务管理器中终止进程。我google了很多,但没有结果。有什么办法可以从 maven(for Jenkins) 中做到这一点?

我尝试了停止目标,但它不起作用:

<execution>
   <id>stop-container</id>
   <phase>post-integration-test</phase>
   <goals>
      <goal>stop</goal>
   </goals>
</execution>

【问题讨论】:

标签: java maven dropwizard acceptance-testing maven-antrun-plugin


【解决方案1】:

由于我没有找到一个 maven 解决方案,我添加了一个任务到 drop 向导来关闭,然后我使用接受模块中的实现类向任务发送 http 帖子。

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.3.2</version>
  <executions>
    <execution>
      <id>stop-container</id>
      <phase>post-integration-test</phase>
      <goals>
        <goal>java</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <mainClass>your.main.class</mainClass>
  </configuration>
</plugin>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多