使用 Eclipse 的 Maven 2 插件开发一个 JEE 项目

本文介绍了如何使用Eclipse的Maven插件创建一个JEE项目,详细步骤包括选择Maven Archetype,配置项目信息,创建目录结构,引入依赖,设置web.xml,创建资源文件夹,并进行Tomcat插件的配置,以便进行项目的断点调试。最后,文章还提及了一个关于人工智能的教程推荐。
摘要由CSDN通过智能技术生成
                        本文是博客《 集成 Maven 2 插件到 Eclipse 的过程》和《 将本地开发的 Maven 2 项目部署到 Linux Tomcat 下的步骤》的姊妹篇。本文介绍如何使用已安装好的 Maven 2 插件开发一个 JEE 项目。
        1. 新建 Maven 项目

        Eclipse 的 Package Explorer 视图下右击 -> New -> Maven -> Maven Project -> Next -> Select project name and location 对话框直接点 Next -> Select an Archetype 对话框,Catalog 选择 "All Catalogs",Filter 选择 Group Id 为 "org.apache.maven.archetypes"、Artifact Id 为 "maven-archetype-quickstart"、Version 为 "1.1" 的那个,点 Next -> Enter an artifact id 对话框,Group Id 输入项目组 "mia",Artifact Id 输入 "noti-service"(最好是你的项目名),Version 输入版本号 "1.0.0",Package 输入主干包名 "com.defonds.noti",点击 Finish,新的 Maven 项目 noti-service 生成。如下图所示:

新建 Maven 项目

        2. 编辑 pom.xml

        根据项目的需要,引入所依赖的包。作者的 pom.xml 示例如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  <modelVersion>4.0.0</modelVersion>  <groupId>mia</groupId>  <artifactId>noti-service</artifactId>  <version>1.0.0</version>  <packaging>jar</packaging>  <name>noti-service</name>  <url>http://maven.apache.org</url>  <properties>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    <spring.version>3.1.2.RELEASE</spring.version>    <httpClient.version>4.1.3</httpClient.version>  </properties>  <dependencies>     <dependency>      <groupId>junit</groupId>      <artifactId>junit</artifactId>      <version>3.8.1</version>      <scope>test</scope>    </dependency>        <!-- uniform spring version and using new spring MVC annotation begin-->   <dependency>  <groupId>org.springframework</groupId>  <artifactId>spring-core</artifactId>  <version>${spring.version}</version> </dependency> <dependency>  <groupId>org.springframework</groupId>  <artifactId>spring-web</artifactId>  <version>${spring.version}</version> </dependency> <dependency>  <groupId>org.springframework</groupId>  <artifactId>spring-orm</artifactId>  <version>${spring.version}</version> </dependency>  <dependency>  <groupId>org.springframework</groupId>  <artifactId>spring-context</artifactId>  <version>${spring.version}</version> </dependency> <dependency>  <groupId>org.springframework</groupId>  <artifactId>spring-webmvc</artifactId>  <version>${spring.version}</version> </dependency> <dependency>  <groupId>org.springframework</groupId>  <artifactId
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值