MyEclipse使用总结——在MyEclipse中新建Maven框架的web项目[转]
前面的文章我们已经在本机安装好了maven,同时在myeclipse中配置好了maven的插件。
链接如下:
现在我们就开始在myeclipse中新建一个maven框架的web项目
新建项目
填写项目名称,一定记得勾选Add Maven support (java EE如果选取5.0报错,则选6.0)
我们的maven项目就新建好了,相关基本的依赖已经在pom.xml中.项目机构如下:
可能出现的错误及解决方案:
遇到的问题----新建maven项目ArtifactTransferException 和Execution default-testResources of goal
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>ipFilterM</groupId>
- <artifactId>ipFilterM</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>war</packaging>
- <name/>
- <description/>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>bean-validator</artifactId>
- <version>3.0-JBoss-4.0.2</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.annotation</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.ejb</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.enterprise.deploy</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.jms</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.management.j2ee</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>javax.persistence</artifactId>
- <version>2.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.resource</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.security.auth.message</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.security.jacc</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.servlet</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.servlet.jsp</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.servlet.jsp.jstl</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.transaction</artifactId>
- <version>3.0.1</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api-osgi</artifactId>
- <version>2.2.1</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>jstl-impl</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4.3</version>
- </dependency>
- <dependency>
- <groupId>javax.xml</groupId>
- <artifactId>webservices-api-osgi</artifactId>
- <version>2.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-osgi-bundle</artifactId>
- <version>1.0.1-SP3</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </project>
到这一步我们的web项目就建好了, 不过还有一步重要的步骤,就是把相关依赖的包下载到本地仓库。
对着项目右键: run as ----> maven install
在控制台就可以看到 依赖包开始自动从 maven的中央仓库开始下载
下载完后我们可以看到build success
到此为止,我们的maven框架的web项目就新建好了。
MyEclipse使用总结——在MyEclipse中新建Maven框架的web项目[转]的更多相关文章
- Eclipse中发布Maven管理的Web项目时找不到类的问题根源和解决办法(转)
转自:http://blog.csdn.net/lvguanming/article/details/37812579?locationNum=12 写在前面的话 现在是越来越太原讨厌Eclipse这 ...
- idea 中利用maven创建java web 项目
转自:http://www.linuxidc.com/Linux/2014-04/99687.htm 本文主要使用图解介绍了使用IntelliJ IDEA 12创建Maven管理的Java Web项目 ...
- eclipse中基于maven构建的web项目pom.xml中指定的jar包无法发布到tomcat中
eclipse运行maven web项目报错: 信息: Starting Servlet Engine: Apache Tomcat/7.0.57 一月 07, 2015 11:50:44 下午 or ...
- Maven入门1-在Eclipse中新建Maven Web项目
在eclipse中新建Maven Web项目 很多时候开发效率低下,大部分原因是IDE环境不熟悉.配置不会配置:因此在学习一项技能之前,有必要对基本的环境配置有所了解,正所谓磨刀不误砍柴工.这篇文章主 ...
- eclipse中使用Maven新建Servlet2.5的Web项目
前言 我们用Eclipse创建Maven结构的web项目的时候选择了Artifact Id为maven-artchetype-webapp,由于这个catalog比较老,用的servlet还是2.3的 ...
- Java web项目搭建系列之一 Eclipse中新建Maven项目
前提条件: 已经安装好JDK 已经安装好Maven 已经安装好Eclipse 已经安装好Maven插件 在Eclipse中新建Maven项目 [File]→[New]→[Other...] [Mave ...
- 在IntelliJ IDEA中新建Maven项目
在IntelliJ IDEA中新建Maven项目,选择“File->New->Project”,创建一个简单项目,不选择模板,如下图所示: 2 选择“Maven”,不需要使用内置结构(模板 ...
- Java归去来第4集:java实战之Eclipse中创建Maven类型的SSM项目
一.前言 如果还不了解剧情,请返回第3集的剧情 Java归去来第3集:Eclipse中给动态模块升级 二.在Eclipse中创建Maven类型的SSM项目 2.1:SSM简介 SSM ...
- 在eclipse中,用maven创建一个web项目工程
1.在eclipse中用maven创建项目,右键new>>Maven Project 2.点击next继续 3.点击next继续,选择maven-archetype-webapp, 4.点 ...
随机推荐
- 在centos6.5 上安装最新版mysql
在mysql上如果直接安装mysql安装的不是5.6版本以上.下面记录怎么解决安装最新版mysql5.6以上. 1.查看本机都安装了mysql什么版本:rpm -qa | grep mysql,默认是 ...
- NodeJS学习笔记之Connect中间件模块(二)
一,开篇分析 大家好,今天这篇文章主要是对"Connect"中间件以及相关辅助中间件,做一个源码分析系列,我想上一篇文章大家也看了, 介绍了使用方式及用途,而这篇也是出于本人的兴趣 ...
- 中文linux安装oracle界面乱码解决方案
来自:http://blog.csdn.net/h249059945/article/details/12122853 在linux的中文操作系统下使用xmanager进行oracle进行安装的时候, ...
- 21-1字符串相关api
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- java oop第09章_JDBC02(CRUD操作)
第09章_JDBC02(CRUD操作) CRUD(CREATE . RETIVE . UPDATE . DELETE)增删改查. DAO中会提供一些CRUD操作方法,调用者可以通过调用这些方法完成相应 ...
- PHP算法之回文数
判断一个整数是否是回文数.回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数. 示例 1: 输入: 121输出: true示例 2: 输入: -121输出: false解释: 从左向右读, ...
- JQuery ajax提交表单及表单验证
JQuery ajax提交表单及表单验证 博客分类: jsp/html/javascript/ajax/development Kit 开源项目 注:经过验证,formValidator只适合一个 ...
- 登录操作(方法一:设置flag标志位)
登录操作(方法一:设置flag标志位) user_name="star"passwoed='123'passed_authentication=Falsecount=0for i ...
- thinkphp 范围标签
范围判断标签包括in notin between notbetween四个标签,都用于判断变量是否中某个范围. 大理石平台价格 IN和NOTIN 用法: 假设我们中控制器中给id赋值为1: $id = ...
- 牛客多校第六场 J Upgrading Technology dp
题意: 有n个技能,一开始都是0级,第i个技能从j-1级升到j级,花费$c_{i,j}$,但是花费不一定是正的 所有的技能升到j级时,奖励$d_j$但是奖励也不一定是正的 题解: 用sum[i][j] ...