MyEclipse使用总结——在MyEclipse中新建Maven框架的web项目[转]
前面的文章我们已经在本机安装好了maven,同时在myeclipse中配置好了maven的插件。
链接如下:
Maven安装----在Windows上安装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项目就新建好了。
转载于:https://www.cnblogs.com/0x2D-0x22/p/4141399.html
MyEclipse使用总结——在MyEclipse中新建Maven框架的web项目[转]相关推荐
- 使用idea新建maven工程的web项目的步骤
1 新建maven项目,配置好目录结构 2 配置tomcat 先打开项目配置 配置访问目录 3 再配置tomcat,配置热更新,首页访问路径 配置tomcat 最后选择首页访问路径(注意:这部不配置的 ...
- myeclipse java maven web 项目结构,Myeclipse 10 Maven 构建 Java Web 项目
下载 Maven http://maven.apache.org/download.cgi,解压到任意非C盘位置,比如:D:\Java\apache-maven-3.1.0 打开 Myeclipse ...
- idea中新建maven项目缺少src目录的根本解决方法(适合萌新 少走弯路)
idea中新建maven项目缺少src目录的根本解决方法(适合萌新 少走弯路) 参考了很多博客,基本都是让在setting下的runner 添加-DarchetypeCatalog=internal参 ...
- Maven-EclipseEE使用Maven构建Java web项目从0到1
Maven是什么 安装Maven 解压apache-maven-350-binzip 新建变量M2_HOME配置Maven主目录 在 Path 变量中添加 Maven的bin目录 命令窗口mvn -v ...
- Eclipse使用Maven插件创建Web项目时出错:Could not resolve archetype org.apache.maven.archetypes
问题描述: 在Eclipse下,使用Maven插件创建Web项目时出错,错误提示如下: 错误信息: Could not resolve archetype org.apache.maven.arche ...
- idea maven创建java项目_新版本IntelliJ IDEA 构建maven,并用Maven创建一个web项目(图文教程)...
之前都没试过用maven来管理过项目,但是手动找包导包确实不方便,于是今天用2016版的IDEA进行了maven的初尝试. 打开IDEA,创建新项目: 然后选择Maven,以及选择自己电脑的jdk: ...
- maven 如何给web项目添加jar包依赖
maven 如何给web项目添加jar包依赖 CreateTime--2018年4月19日19:06:21 Author:Marydon 开发工具:eclipse 1.打开pom.xml文件--> ...
- 关于Maven打包Java Web项目以及热部署插件Jrebel的使用
Java Web/Eclipse/Maven/Tomcat 最近有个新项目是java web项目,记录一下,可能比较乱.虽然没接触过Java,但是eclipse还是用过的 初识项目 同事说,项目是ma ...
- idea用maven搭建的web项目没有src目录只有pom解决方案(最暴力,最简单版本)
用maven搭建的web项目出现的bug解决方法 解决方法: 建议先去看第二种解决方法 一.创建maven 项目 上一步完成以后就可以一直下一步了,中间可以设置一下 maven项目存储位置和名称,本次 ...
- 在k8s中使用gradle构建java web项目镜像Dockerfile
在k8s中使用gradle构建java web项目镜像Dockerfile FROM gradle:6-jdk8 AS build COPY --chown=gradle:gradle . /home ...
最新文章
- 区块链论文:OmniLedger,一种区块链分片技术
- 山寨动力第一篇:明明白白给MK808山寨电视棒安装PicUntu Linux
- python映射类型-什么是python中唯一的映射类型
- 深入理解JVM虚拟机(十一):线程安全与锁优化
- c语言微信昵称大全女生优雅经典的,微信昵称大全女生优雅_有深度有内涵的昵称...
- 修改安装路径 pip 以及修改运行路径
- json取数据怎么取_干货速递丨书名应该怎么取?
- YAML_01 YAML语法和playbook写法
- 计算机专业计算机二级java有用吗_计算机二级java含金量如何 对就业有帮助吗
- mysql山西区位码_输入码、区位码、国标码与机内码关系简介【转载】
- 机器学习(四)神经网络
- 对于Ajax在MUI框架中的用运以及单 webview 模式中的下拉刷新功能探究
- 3-9 G: LZY的时间转化
- 初生牛犊不怕虎 造车新势力的硬核移动互联科技盘点
- noip2012 pj错题整理
- html页面导出word文档
- python的sysfont_pygame.font.SysFont游戏文字交互
- 算法面试用c还是python_排序算法(C语言+Python版)宝宝再也不怕面试官写排序算法了...
- matlab定义双精度型变量_MATLAB小数(浮点数)类型
- 技术控 | 自然语言技术在文智趋势分析产品上的应用