Maven插件执行另一个插件 [英] Maven plugin executing another plugin

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

问题描述

我正在尝试创建一个新插件来打包我的最新项目.我正在尝试让该插件依赖于maven-dependency-plugin来复制我所有的项目依赖项.

I'm trying to create a new plugin to package my latest project. I'm trying to have this plugin depend on the maven-dependency-plugin to copy all my projects dependencies.

我已将此依赖项添加到插件的pom中,但无法执行.

I've added this dependency to my plugin's pom, but I can't get it to execute.

我的插件主Mojo中有此注释:

I have this annotation in my plugins main Mojo:

@execute goal="org.apache.maven.plugins:maven-dependency-plugin:copy"

我已经为目标尝试了其他一些名称,例如 dependency:copy copy ,但它们都以一条消息结尾,提示未达到所需目标在我的插件中找到.我在做什么错了?

I've tried a few other names for the goal, like dependency:copy and just copy but they all end with a message saying that the required goal was not found in my plugin. What am I doing wrong?

第二个是在哪里提供依赖项插件的配置信息?

Secondary to this is where to I provide configuration info for the dependency plugin?

推荐答案

使用 Maven Mojo执行器由Atlassian的Don Don负责运行其他任意插件.

Use the Maven Mojo executor by Don Brown of Atlassian fame to run any other arbitrary plugin.

Mojo执行器提供了一种方法来 在一个程序中执行其他Mojos(插件) Maven 2插件,让您轻松 创建Maven 2插件 由其他插件组成.

The Mojo Executor provides a way to to execute other Mojos (plugins) within a Maven 2 plugin, allowing you to easily create Maven 2 plugins that are composed of other plugins.

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

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