Java EE 7 教程 第一部分 简介 第2章 使用教程示例 第2.7节 教程中的Java EE 7 Maven原型

原文:http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples007.htm
翻译:石卓林 shizhuolin@hotmail.com

2.7 Java EE 7 Maven Archetypes in the Tutorial

Some of the chapters have instructions on how to build an example application using Maven archetypes. Archetypes are templates for generating a particular Maven project. The Tutorial includes several Maven archetypes for generating Java EE 7 projects.

2.7.1 Installing the Tutorial Archetypes

You must install the included Maven archetypes into your local Maven repository before you can create new projects based on the archetypes. You can install the archetypes using NetBeans IDE or Maven.

2.7.1.1 Installing the Tutorial Archetypes Using NetBeans IDE

  • From the File menu, choose Open Project.
  • In the Open Project dialog box, navigate to: tut-install/examples
  • Select the archetypes folder.
  • Click Open Project.
  • In the Projects tab, right-click the archetypes project and select Build.

2.7.1.2 Installing the Tutorial Archetypes Using Maven

  • In a terminal window, go to: tut-install/examples/archetypes/
  • Enter the following command:
    mvn install

2.7 教程中的Java EE 7 Maven原型

部分章节介绍了如何使用Maven原型构建范例应用程序. 原型是用于创建特定Maven项目的模版. 本教程包含若干用于生成Java EE 7项目的Maven原型.

2.7.1 安装教程原型

你必须先安装本教程的Maven原型到本地的Maven仓库,然后才能创建基于对应原型的新项目. 可以使用NetBaens IDE或Maven安装这些原型.

2.7.1.1 使用NetBeans IDE安装教程原型

  • 文件 菜单中, 选择 打开项目.
  • 在打开项目对话框中, 浏览: tut-install/examples
  • 选中原型文件夹.
  • 单点 打开项目.
  • 项目 选项卡中, 右击原型项目并选中Build.

2.7.1.2 使用Maven安装教程原型

  • 在终端窗口中, 跳转到: tut-install/examples/archetypes/
  • 输入以下命令:
    mvn install

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload the CAPTCHA.

Proudly powered by WordPress   Premium Style Theme by www.gopiplus.com
渝公网安渝公网安备 50010702500270号 渝ICP备09056628号-7