运行单个Maven插件执行? [英] Run a single Maven plugin execution?

查看:429
本文介绍了运行单个Maven插件执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以为我是一个经验丰富的Maven用户,但我有一个心理块如何做这个!



我已经能够使用Maven sql插件通过插件执行在数据库中删除,创建和安装模式我定义并绑定到 pre-integration-test 阶段。



然而,现在我想使用同一个sql插件来插入一些示例数据,只要我想从命令行 - 也就是说,不绑定到任何生命周期的目标。有几个不同的样本数据集,所以我想定义几个不同的执行。



但是有一种方法来运行这些执行之一 问题/ 3166538 / how-to-execute-maven-plugin-execution-direct-from-command-line>如何直接从命令行执行maven插件执行?,这个
功能已经< a href =https://git-wip-us.apache.org/repos/asf?p=maven.git;a=commitdiff;h=ee7dbab69dd87d219031b0715105527cdbf12639;hp=cd52e5b51e8e986b6daea8c0b56dd61968410695>已将实施为 MNG-5768 ,并且在Maven 3.3.1中可用。



更改将:


扩展直接插件调用语法以允许可选的@ execution-id参数,例如org.apache.maven .plugins:maven-remote-resources-plugin:1.0:process @ executionId。


id:

  mvn sql:execute @ specific-execution-id 

使用pom中配置的执行。


I thought I was an experienced Maven user, but I am having a mental block on how to do this!

I've been able to use the Maven sql plugin to drop, create, and install a schema in a database via plugin executions I've defined and bound to the pre-integration-test phase.

However, now I'd like to use that same sql plugin to insert some sample data whenever I want from the command line -- that is, not bound to any lifecycle goal. There are a few different sets of sample data, so I'd like to define a few different executions.

But is there a way to run one of these executions from the command line by using the execution ID perhaps?

解决方案

As noted in How to execute maven plugin execution directly from command line?, this functionality has been implemented as MNG-5768, and is available in Maven 3.3.1.

The change will:

extend direct plugin invocation syntax to allow optional @execution-id parameter, e.g., org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process@executionId.

So, as long as you give your execution an id:

mvn sql:execute@specific-execution-id

uses the execution configured in your pom.

这篇关于运行单个Maven插件执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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