2019独角兽企业重金招聘Python工程师标准>>>

1、下载

http://maven.apache.org/download.cgi

2、解压

3、配置环境变量

M2_HOME  D:\program\apache-maven-3.3.3

Path :  %M2_HOME%\bin

4、验证是否成功

打开命令行窗口,输入mvn -version,显示版本号,则安装成功

我这里遇到了错误: Unsupported major.minor version 51.0

这个是jdk版本过低造成的,maven3 要求至少jdk7,。

修改JAVA_HOME指向jdk1.7或者1.8,这个时候再执行mvn -v命令,还是一样的错误提示,重开命令行,重新执行,问题解决。

5、maven的仓库地址是在D:\Program\apache-maven-3.0.4\conf 下的settings.xml 里面配置的,
    属性名是localRepository
     默认地址是:D:\我的文档\.m2\repository
     上面的路径是我自己的电脑里的配置

新安装的3.3.9版,默认地址是C:\Users\he\.m2

6、执行run as-maven install时报错

-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

检查环境变量已经配置了,在控制台输入mvn命令也有效。

解决办法是修改MyEclipse的配置,

在Window->Preference->Java->Installed JREs->Edit

在Default VM arguments中设置

-Dmaven.multiModuleProjectDirectory=$M2_HOME

7、可以在maven网站上选择jar包,并自动生成pom.xml里的配置,复制即可

地址:http://search.maven.org/

8、在MyEclipse中创建maven项目之后报下面的错误

Failure to transfer org.codehaus.plexus:plexus-io:jar:1.0 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-io:jar:1.0 from/to central (http://repo1.maven.org/maven2): No response received after 60000

这个错误是更新jar包失败,解决办法是去本地仓库删掉对应的包,然后在项目上点击右键->Maven4MyEclipse->Update Dependencies ,如果报其他的包更新失败,也采取同样的办法

9、在命令行中想要操作指定的项目,需要首先进入需要构建的项目目录,然后执行mvn的相关命令。

10、将jar包部署到jboss的方法

首先配置jboss的plugin,在pom.xml中添加以下语句

   <plugin><groupId>org.codehaus.mojo</groupId><artifactId>jboss-maven-plugin</artifactId><version>1.5.0</version><configuration><jbossHome>E:\Program\jboss-eap-5.0\jboss-as</jbossHome><serverName>default</serverName></configuration></plugin>

然后在项目目录下执行命令

 mvn clean install jboss:hard-undeploy jboss:hard-deploy jboss:start

11、No persistence.xml file found in project

解决办法:psersistence.xml要放在META-INF下面

12、The method setApplicationContext(ApplicationContext) of type ApplicationContextUtils
 must override a superclass method
解决办法:将jdk版本从1.5换成1.6

13、使用maven构建项目时报错:gbk的不可映射字符

解决办法:在编译插件上添加配置项<encoding>utf8</encoding>,详细代码如下

   <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>2.3.1</version><configuration><source>1.6</source><target>1.6</target><encoding>utf8</encoding></configuration></plugin>

14、Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”

明明已经引入了jstl包,但是还是报这个错误

解决办法:把jstl的依赖删除重新加入就好了

15、VERSION OF SPRING FACET COULD NOT BE DETECTED.
The migration process needs to detect the correct version of Spring support used by a project. If the process fails to detect the version based on containers used by the project, it tries to read it from the .springBeans file. If the file is missing, the migration process is unable to continue.

You need to manually create the file in the root of the project, before invoking the Migration wizard. To do so, right-click the project, and select New>File from the menu. Enter .springBeans as the file name, and click Finish. The .springBeans file editor should open. Paste the following code into it, and save the file.

<?xml version="1.0" encoding="UTF-8"?>
<beansProjectDescription>
  <springVersion>2.0</springVersion>
</beansProjectDescription>

Now you can rerun the migration process by selecting MyEclipse>Migrate Projects from theMyEclipsemenu, or run the process from the Project Migration view.

Note: The .springBeans file might not appear in the Package Explorer view; you will need to disable the.* resources filter to see it. To do so, click the white triangle (View menu) in the top-right corner of the Package Explorer view and select Filters. Next, deselect the .* resources filter, and click OK. You should now be able to see the .springBeans file.

16、webrootkey已经注册

解决办法,在web.xml文件里添加参数

<context-param><param-name>webAppRootKey</param-name><param-value>cmes_web.root</param-value>
</context-param>

17、pom.xml中使用环境变量

    <plugin><groupId>org.codehaus.mojo</groupId><artifactId>jboss-maven-plugin</artifactId><version>1.5.0</version><configuration><jbossHome>${env.JBOSS_HOME}</jbossHome><serverName>default</serverName></configuration></plugin>

转载于:https://my.oschina.net/u/173975/blog/530443

maven3安装和使用笔记相关推荐

  1. freebsd mysql 安装_Freebsd中mysql安装及使用笔记-阿里云开发者社区

    Freebsd中mysql安装及使用笔记 x3d 2009-07-31 662浏览量 简介: 1.安装 一开始连mysql的软件包在freebsd中叫什么都不知道: 依稀属于databases类,先到 ...

  2. CENTOS7.2使用RDO方式安装OpenStack Mitaka笔记

    CENTOS7.2使用RDO方式安装OpenStack Mitaka笔记 1.配置/etc/hosts 192.168.13.108 openstack 2.配置OpenStack Mitaka安装源 ...

  3. docker 安装git_docker随手笔记第十二节 jenkins+docker+nginx+纯静态页面配置

    docker随手笔记第一节 docker概念及安装 docker随手笔记第二节 docker常用命令解析 docker随手笔记第三节 docker构建java镜像 docker随手笔记第四节 dock ...

  4. Linux系统使用--Ubuntu 16.04 安装为知笔记

    一.前言 为了测试MetaWebBlog协议在为知笔记的使用情况,需要安装为知笔记. 二.准备工具和环境搭建 2.1 准备工具 安装Linux版的为知笔记需要准备很多必要的工具,现列表如下: 1. Q ...

  5. V-Rep虚拟机器人实验平台在Ubuntu18.04LTS安装与使用笔记

    V-Rep在Ubuntu18.04LTS安装与使用笔记 V-Rep官网链接如下,一直很困惑有两个地址,打开还字体不一样... 1. http://www.v-rep.eu 2. http://www. ...

  6. RedHat EL5 x86-64上命令行安装Oracle 10g笔记

    RedHat EL5 x86-64上命令行安装Oracle 10g笔记 声明:本文中所描述的系统命令,未经特殊标示,均为"#"代表root权限,"$"代表ora ...

  7. Spark下载和安装(学习笔记)

    夫君子之行,静以修身,俭以养德,非淡泊无以明志,非宁静无以致远. 夫学须静也,才须学也,非学无以广才,非志无以成学.淫慢则不能励精,险躁则不能冶性. 年与时驰,意与日去,遂成枯落,多不接世,悲守穷庐, ...

  8. 在 Ubuntu 16.04 中 安装为知笔记

    个人博客原文:在 Ubuntu 16.04 中 安装为知笔记 摘要:本文讲述如何在 Ubuntu 16.04 中编译安装为知笔记. 安装依赖的软件 git sudo apt-get install g ...

  9. ant的下载与安装——mybatis学习笔记之预备篇(一)

    看到这个标题是不是觉得有点奇怪呢--不是说mybatis学习笔记吗,怎么扯到ant了?先别急,请容我慢慢道来. mybatis是另外一个优秀的ORM框架.考虑到以后可能会用到它,遂决定提前学习,以备不 ...

最新文章

  1. java applet 官网_java applet
  2. 4.1 基础-放苹果(整数划分)
  3. 「神策 2020 数据驱动用户大会」10 月 13 日即将开幕,5 大亮点提前解锁!
  4. 深入浅出MySQL事务处理和锁机制
  5. leetcode 210. Course Schedule II | 210. 课程表 II(Java)
  6. jps: command not found
  7. 单调栈 leetcode整理(一)
  8. FreeModbus移植到STM32F107(以太网传输方式)
  9. coreldraw x5 选择工具快捷键_CorelDRAW设置和优化提高工作效率
  10. ctype.h(c标准库)
  11. 【知识图谱系列】基于Randomly Perturb的图谱预训练模型GraphCL
  12. LinkedIn应用开发系列(三) --认证Request token
  13. python爬虫用AI技术-破解企业工商数据抓取+网络爬虫+网站数据采集+数据抓取遇到的三大问题
  14. 计算机领域国际顶级会议
  15. Youtube 开发通过遥控机控制实现快进快退功能
  16. linux最新flash+player,Linux版Flash Player正式回归
  17. 天津师范大学计算机与信息工程学院研究生院,天津师范大学计算机与信息工程学院2020考研调剂信息...
  18. Vue项目H5移动端在线预览PDF文件
  19. 第十六届全国大学生智能汽车比赛—摄像头算法控制总结
  20. 大乘起信论别记(本)

热门文章

  1. 前端人员如何在linux服务器上搭建npm私有库
  2. 触屏网站如何实现返回并刷新
  3. LoadRunner中进程运行和线程运行区别
  4. 根目录下各文件夹的作用
  5. c# 实现MD5,SHA1,SHA256,SHA512等常用加密算法
  6. b样条曲面绘制 opengl_CAD制图软件中如何利用EXCEL输入坐标绘制曲线?
  7. python画枫叶_python-文件的操作
  8. Android 电量优化
  9. 程序员必须知道的HTML常用代码有哪些?
  10. Shell 学习笔记之运算符