如何从控制台运行 Maven 插件

发布于 2024-12-19 03:34:50 字数 683 浏览 3 评论 0原文

我正在开发 Maven 插件

<modelVersion>4.0.0</modelVersion>
<groupId>com.breedish.cfit</groupId>
<artifactId>maven-cfitautomator-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>cfitautomator</name>

但是我如何从控制台运行它? 如果我运行 com.breedish.cfit:maven-cfitautomator-plugin:1.0-SNAPSHOT:run-goal 它总是说:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: run-goal. It requires a project with an existing pom.xml, but the build is not using one.

I'm developing maven plugin

<modelVersion>4.0.0</modelVersion>
<groupId>com.breedish.cfit</groupId>
<artifactId>maven-cfitautomator-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>cfitautomator</name>

But how i can run it from console?
if i run com.breedish.cfit:maven-cfitautomator-plugin:1.0-SNAPSHOT:run-goal it is always saying:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: run-goal. It requires a project with an existing pom.xml, but the build is not using one.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

故人爱我别走 2024-12-26 03:34:50

深入了解 maven-invoker-plugin 它可以为您提供支持开发 Maven 插件并进行环境集成测试等。因此您不需要手动安装该插件并手动测试它。

Take a deep look at the maven-invoker-plugin which can support you in developing Maven plugins with integration tests with environment etc. So you don't need to manually install that plugin and test it by hand.

不弃不离 2024-12-26 03:34:50

您似乎没有在包含 pom 文件的目录中运行此命令。

它说它需要一个 POM 文件。

It seems you are not running this command in a directory which contains a pom file.

It says it needs a POM file.

时光清浅 2024-12-26 03:34:50

使用 mvn install 将插件安装到本地存储库。然后按照您发布的方式使用它。

Install your plugin to local repository using mvn install. Then use it as you posted.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文