下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、maven实战学习笔记(6)groupid org.codehaus.cargo /groupid artifactid cargo-maven2-plugin /artifactid version 1.0.3 /version !- 插件的toat6.x配置 - configuration wait ue /wait !-是否解释,操作start、stop等后续操作必需等前面操作完成才干继续 - container !- 容器的配置 - containerid tom6x /containerid !- 指定tomcat版本,tomcat7x不支持远程部署,可以为tomcat5x,tomc
2、at6x - type remote /type !- 指定类型:表示远程部署- /container configuration !- 详细的配置 - type run /type !- 类型,tomcat运行时 - properties !- 配置属性 - cargo.tomcat.manager.url http:/localhost:8080/manager /cargo.tomcat.manager.url !- 管理地址 - cargo.remote.username admin /cargo.remote.username !- tomcat用户名 - cargo.remote.
3、password admin /cargo.remote.password !- tomcat密码 - /properties /configuration /configuration eions !- 执行的动作,假如不指定,可以执行执行n cargo:reploy ,需要在tings.xml中声明groupid - execution verify-deployer /id phase install /phase !- 关联到install阶段,执行mvn install即可完成部署 - goa goal redeploy /goal !- 实际调用cargo的redeploy目标 -
4、 /goals /execution /executions /plugin /plugins /build 二。本地部署 1.用法cargo-maven2-plugin插件 1.1standalone 启动:mvn install build finalname hello /finalname plugins plugin !- 指定插件名称及版本号 - groupid org.codehaus.cargo /groupid artifactid cargo-maven2-plugin /artifactid version 1.0.3 /version !- 插件的tomcat6.x配置
5、 - configuration wait true /wait !-是否解释,操作start、stop等后续操作必需等前面操作完成才干继续 - container !- 容器的配置 - containerid tomcat7x /containerid !- 指定tomcat版本 - home f:maven_workspaceapache-tomcat-7.0.5-windows-x86apache-tomcat-7.0.5 /home !- 指定tomcat的位置 - /container configuration !- 详细的配置 - type standalone /type !-
6、 类型,standalone:复制tomcat配置到指定位置 existing:挺直部署到tomcat的webapps - home $project.build.directory/tomcat7 /home !- 指定复制tomcat到什么位置,真正的工作名目 - properties !- 配置属性 - cargo.servlet.port 8081 /cargo.servlet.port !- 端口 - /properties /configuration /configuration executions !- 执行的动作,假如不指定,可以执行执行mvn cargo:start,需要
7、在settings.xml中声明groupid - execution id verify-deployer /id phase install /phase !- 关联到install阶段,执行mvn install即可完成部署 - goals goal start /goal !- 实际调用cargo的start目标 - /goals /execution /executions /plugin /plugins /build 1.2existing 启动指令:mvn install build finalname hello /finalname plugins plugin !- 指定
8、插件名称及版本号 - groupid org.codehaus.cargo /groupid artifactid cargo-maven2-plugin /artifactid version 1.0.3 /version !- 插件的tomcat6.x配置 - configuration wait true /wait !-是否解释,操作start、stop等后续操作必需等前面操作完成才干继续 - container !- 容器的配置 - containerid tomcat7x /containerid !- 指定tomcat版本 - home f:maven_workspaceapac
9、he-tomcat-7.0.5-windows-x86apache-tomcat-7.0.5 /home !- 指定tomcat的位置 - /container configuration !- 详细的配置 - type standalone /type !- 类型,standalone:复制tomcat配置到指定位置 existing:挺直部署到tomcat的webapps - home f:maven_workspaceapache-tomcat-7.0.5-windows-x86apache-tomcat-7.0.5 /home !- 指定tomcat的位置 - /configurati
10、on /configuration executions !- 执行的动作,假如不指定,可以执行执行mvn cargo:start,需要在settings.xml中声明groupid - execution id verify-deployer /id phase install /phase !- 关联到install阶段,执行mvn install即可完成部署 - goals goal start /goal !- 实际调用cargo的start目标 - /goals /execution /executions /plugin /plugins /build 2.用法jetty-mave
11、n-plugin 启动指令:mvn install build finalname hello /finalname plugins plugin groupid org.mortbay.jetty /groupid artifactid jetty-maven-plugin /artifactid version 8.0.4.v20111024 /version configuration scanintervalseconds 10 /scanintervalseconds webappconfig contextpath /test /contextpath !- 测试时没有起作用,只能
12、通根路径拜访,既localhost:8080,应当是maven版本的问题,maven2下用法其它版本的jetty-maven-plugin,构建时会报错,maven3下用法该插件没有问题 - /webappconfig /configuration executions !- 执行的动作 - execution id verify-deployer /id phase install /phase goals goal run /goal /goals /execution /executions /plugin /plugins /build 以上插件假如要在指令行执行其各自的指令简写,需要
13、在settings.xml中配置 plugingroups plugingroup org.mortbay.jetty /plugingroup plugingroup org.codehaus.cargo /plugingroup /plugingroups 三。本地测试-tomcat热部署debug maven tomcat eclipse debug 调试 + hot code replace 热部署 参考资料: maven tomcat eclipse debug 调试 + hot code replace 热部署 文章分类:java编程上网找了好久都没找到,网上惟独运行mvn pac
14、kage 打包,并利用tomcat manager功能部署到tomcat 下的文章,假如我修改了一个java文件,不得不重新打包部署一下,这佯做开发效率极低,影响用maven的情绪,经过自己的反复实验,最终可以采取hot code replace了,就是修改了一个文件不用重新部署了,就可以用法debug了。 实验环境: eclipse+ tomcat+ tomcatplugin+maven3 关于怎么安装,就得大家自己找文章了 我们用petclinic项目为大家演示热部署。petclinic是spring正式的一个十分经典的例子 petclinic svn路径 https:/src.sprin
15、/svn/spring-samples/petclinic/trunk 配置用法 1。修改tomcat的server.xml文件,加入 1 context docbase="e:workspacepetclinicsrcmainwebapp" path="/petclinic" reloadable="false" /context 意思是指定tomcat运行项目的名目,在这里我们指定e:workspacepetclinicsrcmainwebapp ,srcmainwebapp 是maven web规范,
16、存放java web的相关资源。 2。右键单击项目,挑选build path,将default output er设置为 petclinic/src/main/webapp/web-inf/classes,并将 petclinic/src/main/resource的excluded设置为none,默认是*,意思是让eclipse编译java和resource文件编译到petclinic/src/main/webapp/web-inf/classes名目 3。 运行 mvn war:inplace petclinic/src/main/webapp/web-inf下,就有lib文件了 4。用e
17、clipse插件运行tomcat,项目就可以运行了,修改随意一java类,可以实时生效,打断点也能够调试了。 注重:要关联tamcat下的jar包。 该配置可以 聚合项目的debug,在需要debug外部项目时手工关联即可。 举例:.classpath ?xml version="1.0" eoding="utf-8"? classpath classpathentry kind="src" output="src/main/webapp/web-inf/classes" path="src/main/r
18、esources"/ classpathentry kind="src" output="src/main/webapp/web-inf/classes" path="src/main/java"/ classpathentry kind="src" output="target/test-classes" path="src/test/java"/ classpathentry kind="src" output="target/te
19、st-classes" path="src/test/resources"/ classpathentry kind="con" path="org.eclipse.jdt.launching.jre_container/ernal.debug.ui.launcher.standardvmtype/j2se-1.5"/ classpathentry kind="con" path="org.maven.ide.eclipse.maven2_classpath
20、_container"/ classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimetarget/apache tomcat v7.0"/ classpathentry kind="output" path="target/classes"/ /classpath 但这样会有一个问题,就是假如有需要替换为maven属性的资源文件就不会被替换了。可以用法jetty-maven-plugin解决这个问题,不过就是path尚不好使。 所以,可以用法上面的配置方式与maven-antrun-plugin插件结合,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 容声428培训课件
- 家长会防溺水安全课件
- 2026年宠物美容店经营合同协议
- 2026年小区停车车位租赁合同
- 2026年水果零售供货合同模板
- 家长书院培训素材
- 2026年技术保密劳动合同协议
- 2026年大件应急运输合同
- 2026年体育场馆餐食服务合同协议
- 2026年脚手架租赁结算合同协议
- DB31∕T 1450-2023 旅游码头服务基本要求
- 南宁陈教练2026年版考试大纲广西专升本与职教高考(财经商贸大类)考试大纲对比分析及备考攻略
- 2025至2030中国电力设备检测行业项目调研及市场前景预测评估报告
- 人工智能与创业智慧(北京林业大学)学习通网课章节测试答案
- 浪浪山小妖怪开学第一课课件
- 工控机维修基础知识培训课件
- 商业中心项目营销推广方案
- 桂林学院《新时代中国特色社会主义与实践》2024-2025学年第一学期期末试卷
- 企业无违规经营声明范本模版
- 2025年医疗器械直调申请表
- 道桥模拟考试题与答案
评论
0/150
提交评论