如何在eclipse中执行maven任务(Sonatype插件)

发布于 2024-09-01 10:25:04 字数 400 浏览 6 评论 0原文

我知道它一定很简单,但我就是想不通。

我在 eclipse 上使用 Sonatype maven 插件。当我想为 webapp 项目构建 war 文件时,我知道的唯一方法是使用命令行并输入 mvn package。

我已经浏览了右键菜单,但找不到任何方法可以从 Eclipse 中做到这一点。

有一个 Maven 子菜单似乎没有与构建有关的选项,并且有一个运行菜单似乎不正确 - 我不想运行我的项目 - 我只想构建它。运行菜单中有一个 Maven 构建选项,但是如果我运行它,会弹出一个配置窗口,让我输入目标。

我该如何做一个简单的 mvn 包,但通过 gui?我缺少什么?

谢谢!

谢谢你们! 两个回复都回答了我的问题.. 现在我遇到了构建不起作用的新问题,但我会将其发布在一个新问题中。

I know it must be something simple, but I just can't figure it out..

I'm using the Sonatype maven plugin on eclipse. When I want to build a war file for a webapp project, the only way I know to do it is to use the command line and type mvn package.

I've looked all through the right click menu and I can't find any way to do it from eclipse.

There's a maven submenu that seems to have no options to do with building, and there's a run menu that doesn't seem right - I don't want to run my project - I just want to build it. There is a maven build option in the run menu, but if I run it, a configuration window pops up for me to enter goals in..

How I do I just do a simple mvn package, but through gui? What am I missing?

Thanks!

Thanks guys!
Both responses answer my question..
Now I have new problems that the build doesn't work, but I'll post that in a new question.

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

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

发布评论

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

评论(2

唔猫 2024-09-08 10:25:04

查看“运行方式”下的菜单,您会发现“Maven 构建”,其中包含一个对话框,您可以在其中定义不同的目标等。

Take a look into the menu under that "Run As" there you find "Maven build" with a dialog where you can define different goals etc.

一抹苦笑 2024-09-08 10:25:04

如果您的项目是 Maven 项目,请在您的项目上右键单击并选择运行方式 > Maven Build 创建您自己的配置(目标、配置文件等)或使用预先存在的配置之一。

http://www.imagebanana.com/img/ja7wh7m0/screenshot_008.png

运行Maven Build运行配置后,它也会列在“运行方式...”绿色箭头下:

替代文本 http://img8.imageshack.us/img8/8510/screenshotrun.png

您可以添加它如果你愿意的话,可以作为最爱。

If your project is a Maven project, right-click on your project and select Run As > Maven Build to create your own configuration (goals, profiles, etc) or use one of the preexisting configuration.

http://www.imagebanana.com/img/ja7wh7m0/screenshot_008.png

Once you've run a Maven Build Run Configuration, it will also be listed under the "Run As..." green arrow:

alt text http://img8.imageshack.us/img8/8510/screenshotrun.png

You could add it as favorite if you want.

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