MyEclipse使用总结——在MyEclipse中新建Maven框架的web项目[转]
2024-09-03 21:18:38
前面的文章我们已经在本机安装好了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项目就新建好了。
最新文章
- 详解Paint的setPathEffect(PathEffect effect)
- 我们为之奋斗过的C#-----Bank系统
- CentOS命令登录MySQL时,报错ERROR 1045 (28000):
- SSH连接时出现Host key verification failed的原因及解决方法
- NSUserDefaults(数据存储)
- javascript基础学习(十三)
- [原创]零基础R语言教程---第一课---认识R语言
- DescribingDesign Patterns 描述设计模式
- iOS使用NSMutableAttributedString
- 201521123006 《Java程序设计》第3周学习总结
- 2017 Multi-University Training Contest - Team 9 1005&;&;HDU 6165 FFF at Valentine【强联通缩点+拓扑排序】
- MFC多线程
- PHP 图片base64 互转
- vue安装遇到vue不是内部变量
- MVC开发T4代码生成之一----文本模板基础
- DAY2---Python---While循环,格式化输出,运算符,编码
- Shell 脚本进阶2
- 【转载】Oracle 中count(1) 、count(*) 和count(列名) 函数的区别
- win7 装docker
- POJ 3436 ACM Computer Factory 最大流,拆点 难度:1
热门文章
- <;mysql>;mysql基础学习
- Reading books /// Prim+BFS oj21633
- Victor and String HDU - 5421 双向回文树
- neo4j常用cypher语句
- Leetcode973. K Closest Points to Origin最接近原点的K个点
- openwrt_ipsec_racoon.init 分析
- 数据提取--JSON
- csp-s模拟测试87
- pycharm同时使用python2.7和python3.5设置方法
- STM32F4X 关于MDK上虚拟串口调试