`
wanghaisheng
  • 浏览: 89817 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

maven学习9——在 Eclipse 3.2 中使用 Maven 2 Plug-in

阅读更多

在 Eclipse 3.2 中使用 Maven 2 Plug-in

本节涵盖了 Eclipse 中 Maven 2.x Plug-in 的一些常用功能。

在您的项目可以使用 Maven 2 插件功能前,需要在一个 Eclipse 项目中启用 Maven 属性。右键单击您想要向其中添加 Maven 支持的项目,选择 Maven2>Enable

为确保项目的目录结构符合 Maven 的预期,您应先创建 Maven 目录结构(或者手动或者使用 Archetype),然后将该项目添加到 Eclipse 中。

在存储库中实时搜索依赖项

使用插件将依赖项添加到 pom.xml 很简单。右键单击该项目的 pom.xml,然后选择 Maven2>Add Dependency。这会启动 Repository Search 向导。键入您要寻找的依赖项名称开头的一些字母,该向导会在中央存储库中搜索任何相匹配的工件。相匹配的工件的所有详情都会呈现给您,以帮助您选择依赖项。图 11 显示了搜索 JUnit 工件的结果:


图 11. Maven Repository Search 向导
Maven Repository Search 向导

一旦选定了想要的工件的版本,单击 OK,插件就会自动地将一个新的 <dependency> 元素添加到 pom.xml 中。


调用 Maven 构建

一个构建涉及到能从 Eclipse 中启动的生命周期的任何阶段。首先,确保启用了 Maven 的项目当前是打开的。然后,从 Eclipse 菜单中选择 Run>External Tools>External Tools...。这将显示 External Tools 向导,如图 12 所示:


图 12.使用 Eclipse External Tool 向导通过 Maven 构建
使用 Eclipse External Tool 向导通过 Maven 构建

给这个配置文件起名,然后通过单击 Goals... 按钮选择一个生命周期阶段。单击 Run 运行 Maven。

Maven 输出显示在 Eclipse 的 Console 选项卡中。

分享到:
评论

相关推荐

    Eclipse 4 Plug-in Development by Example: Beginner's Guide

    "Eclipse Plugin Development by Example: Beginner's Guide" takes the reader through the full journey of plug-in development, starting with an introduction to Eclipse plug-ins, continued through ...

    eclipse-rcp-2022-06-R-linux-gtk-x86_64.tar.gz

    A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client Applications or Remote Application Platform (RCP+RAP), plus Maven and Gradle tooling, and an XML editor....

    eclipse-rcp-2022-06-R-win32-x86_64.zip

    A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client Applications or Remote Application Platform (RCP+RAP), plus Maven and Gradle tooling, and an XML editor....

    eclipse 3.7+maven plug jar

    maven 到 eclipse 集成插件jar包 maven3.0+eclipse3.7

    eclipse-rcp-2022-06-R-linux-gtk-aarch64.tar.gz

    A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client Applications or Remote Application Platform (RCP+RAP), plus Maven and Gradle tooling, and an XML editor....

    eclipse-rcp-2022-06-R-macosx-cocoa-x86_64.dmg

    A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client Applications or Remote Application Platform (RCP+RAP), plus Maven and Gradle tooling, and an XML editor....

    Maven Eclipse-CS Plug-in-开源

    Maven 1.0.X插件会自动为Eclipse Checkstyle插件生成.checkstyle文件。

    eclipse-rcp-2022-06-R-macosx-cocoa-aarch64.dmg

    A complete set of tools for developers who want to create Eclipse plug-ins, Rich Client Applications or Remote Application Platform (RCP+RAP), plus Maven and Gradle tooling, and an XML editor....

    dex2jar-plugin:Dex2Jar 的 Eclipse 插件

    使用 maven 构建 Dex2Jar 后,将/dex-tools/dex2jar-0.0.xx-SNAPSHOT.zip的内容/dex-tools/dex2jar-0.0.xx-SNAPSHOT.zip到一个文件夹中。 在 Eclipse 中选择File &gt; New &gt; Other... &gt; Plug-in Development &gt; Plug-in...

    Maven报错: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources

    idea创建Maven项目时,报错显示Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources,并且Maven插件内看不到 mybatis-generator。如下图: 折腾了好久发现配置放错地方了,...

    eclipse-luna 64位

    Eclipse Luna includes official support for Java 8 in the Java development tools, Plug-in Development Tools, Object Teams, Eclipse Communication Framework, Maven integration, Xtext, Xtend, Web Tools ...

    editorconfig-eclipse

    editorconfig-eclipse ...右键点击项目 -&gt; 导出 -&gt; Deployable Plug-ins and Fragments -&gt; "Instal into host.Repository" -&gt; Finish 重启后eclipse顶部会有一个菜单“EditorConfig”。 支持: indent

    TricentisVehicleInsuranceApplication

    Eclipse 2020-09(4.17)或更旧的版本(请检查“ Cucumber Eclipse Plug-in”对较新的Eclipse版本的支持); CucumberEclipse插件(通过“帮助”菜单上的“安装新软件...”或“ Eclipse市场...”安装)。 观测值: ...

    myeclipse的优化

    Window &gt; perferences &gt; General &gt; Startup and Shutdown &gt; 将Plug-ins activated on startup 中的复选框有选择性的勾选去掉。 7 修改MyEclipse编辑JSP页面时的编辑工具 Window &gt; perferences &gt; General &gt; ...

    phoenix-plugin:凤凰插件

    phoenix-plugin使用说明 一、概述 Phoenix-Plugin 是一个使用jdbc封装了操作Hbase的工具类....在maven的工程中,在目录src/main/resources添加一个名为hbase-phoenix.xml的文件。如下目录: src --main --resour

    eclipsemave插件文件

    eclipsemave插件文件

Global site tag (gtag.js) - Google Analytics