如何显示可用目标列表? [英] How to display a list of available goals?

查看:79
本文介绍了如何显示可用目标列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Maven并不陌生,我经常发现自己想要了解目标方面的实际含义.

I'm rather new to Maven and I often find myself wanting to see what's actually there in terms of goals.

因此,是否有一个命令列出了所有可用目标,例如给定前缀?

So, is there a command which lists all available goals for e.g. a given prefix?

推荐答案

由于Maven是开放的插件系统,因此最佳答案可能是"Google" ;-).如果您指的是所有构建生命周期阶段,则它们是静态的,可以在

Since Maven is an open system of plugins, the best answer is probably "Google" ;-). If you mean all build lifecycle phases, they are static, and can be found at http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html and at other places.

然后,对于给定的插件,帮助插件可以用来获取可能的目标及其所有参数:

Then, for a given plugin, the help plugin can be used to get the possible goals and all their parameters:

mvn help:describe -DgroupId=org.apache.maven.plugins \
                  -DartifactId=maven-war-plugin \
                  -Ddetail=true

但这并不能真正回答您的问题,尤其是给定前缀"部分.为此,最好的解决方案可能是对BASH使用**自动完成功能(**不确定是否会穷尽).例如,参见使用BASH的Maven 2.x自动完成指南.要使bash完成在Windows下工作,您需要CYGWIN.请参阅 Bash中的Maven标签自动完成,以获取详细的设置步骤(以及更好"的自动设置完成脚本).

But this doesn't really answer your question, especially the "for a given prefix" part. For this, the best solution might be to use **auto completion with BASH (**not sure it will be exhaustive though). See for example the Guide to Maven 2.x auto completion using BASH. To get bash completion working under Windows, you'll need CYGWIN. See Maven Tab Auto Completion in Bash for detailed setup steps (and a "better" working auto completion script).

这篇关于如何显示可用目标列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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