已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Maven管理的jar没有发布到WEB-INF/lib下的解决方案标准web工程在eclipse中利用m2eclipse插件添加依赖管理后,在部署过程中没有将依赖的jar包自动拷贝到/WEB-INF/lib中。参考了一些朋友的做法手动执行javaview plaincopy1. mvndependency:copy-dependencies-DoutputDirectory=src/main/webapp/WEB-INF/lib-DincludeScope=runtime命令将jar包拷贝到/WEB-INF/lib目录下。这种做法固然可以,但是也会带来一些不便。1、需要手动执行命令。2、不能时时更新。 以下列出网上查找到的解决方法,m2eclipse plugin方式已验证通过。通过验证eclipse版本:eclipse-jee-helios-SR2-win32m2eclipse插件地址:/sites/m2e标准web工程通过m2eclipse添加依赖管理步骤:1、“Maven ” “Enable dependency Management“2、Web Deployment Assembly中添加maven dependencies步骤如下图:工程 - 右键 - preferences.classpath文件中会有修改xhtmlview plaincopy1. 为xhtmlview plaincopy1. 2. 3. 4. 5. (执行“Maven ” “Update Project Configuration “未生效,故手动添加。必须deploy时候才会拷贝jar包到lib目录下,而非在更新maven依赖时候拷贝jar包。)以下为原文内容:Eclipse : Web Deployment Assembly & Maven dependencies issuePublished: September 3, 2010 , Updated: September 3, 2010 , Author: mkyongprintProblemIn Eclipse 3.5 or early version, in order to deployed the Maven dependencies to the correct “/WEB-INF/lib” folder, you have to configure the dependencies via “Java EE Module Dependencies”, and the updated “.classpath” file will look like following :File : “.classpath”, by Java EE Module Dependenciesxhtmlview plaincopy1. .2. 4. 5. 6. 7. 8. .Since Eclipse 3.6, the “Java EE Module Dependencies” is replaced by “Web Deployment Assembly”, but you can do the same via the “Referenced Projects Classpath Entries”, however, it will update the “.classpath” file as following :File : “.classpath”, by Web Deployment Assemblyxhtmlview plaincopy1. .2. 4. 5. 6. 7. 8. .Sadly, the default(value=”./”)makes all the Mavens dependencies failed to deploy.SolutionNot a big issue, you still can modify the(value=”./”)to(value=”/WEB-INF/lib”)manually, but it will get override every time you run a Maven build. No worry, there are still have two solutions :1. WTP SupportIgnore the “Referenced Projects Classpath Entries” settings, instead, make the Maven supports WTP 2.0javaview plaincopy1. mvneclipse:eclipse-Dwtpversion=2.0It will generate a new file named “ponent“, under “settings” folder, see a portion of this file :File : “ponent”, by WTPxhtmlview plaincopy1. .2. 4. uses5. 6. .With WTP support, it helps to deploy the Maven dependencies to “/WEB-INF/lib” folder correctly.2. m2eclipse pluginInstall them2eclipse, an Eclipse plugin to integrate Maven into the Eclipse IDE. After the installation, right click on the project folder, select “Maven” “Update Project Configuration“, it will update the “.classpath” file accordingly, see a snippetFile : “.classpath”, by m2eclipsexhtmlview plaincopy1. .2. 3. 4. 5. 6. 7. .It helps to deploy the Maven dependencies correctly as well.Reference1. /2. /maven/maven-dependency-libraries-not-deploy-in-eclipse-ide/3. /forums/inde
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- T/COSHA 59-2025工矿内燃机车新能源改造安全技术规范
- T/SZCH 1-2019苏州市商务策划评价规范
- T/FJEMIA 8-2023 T/AHEMA 28-2023臭气检测人员培训技术规范
- T/CI 1290-2025多模态大模型安全检测技术规范
- T/CAAMTB 105-2023新能源汽车越野性能评级方法
- T/COOA 017-2025近视管理框架眼镜验配技术规范
- 2025~2026学年安徽六安市霍邱县北师大版四年级下册6月期末数学试卷【附答案】
- 2025-2026学年吉林省图们市初中历史七年级期末下册通关精准押题卷附答案
- 人工智能在档案数字化中的智能识别
- Photoshop高级技能考试试题及详细答案
- 2026年初级注册安全工程师(安全生产实务)考试题及答案
- 2026年《安全生产技术基础》68个高频考点总结
- Unit 4 Our Memory Section B 1a-1e 课件2026-2027学年人教版九年级英语上册
- 2026年北京市定向招录选调生录用考试真题及答案解析
- 2026年深圳网约车考试题库(含答案)
- 青海省城乡建设领域碳达峰实施方案
- 中国社会科学院招聘专业技术人员笔试真题2024
- 低级错误的预防及反思
- 工程索赔报告范文
- 清包工合同模板
- 2024年福建新华发行集团有限责任公司招聘笔试参考题库含答案解析
评论
0/150
提交评论