Maven的课堂笔记4

9.MavenMyEclipse2014结合

 

MyEclipse10以上的版本,Maven支持的就比较好

 

9.2 Myeclipse配置

 

本地文件夹的C盘的.m2文件夹下必须得有这个settings.xml文件

不配置这个settings.xml文件的话,myeclipse会从互联网上下载需要的jar.

 

9.3 修改pom文件

 

添加jar包

 

<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>SSH</groupId><artifactId>SSH</artifactId><version>0.0.1-SNAPSHOT</version><packaging>war</packaging><name>SSH</name><description/><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.9</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>3.2.2.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>3.2.2.RELEASE</version></dependency><dependency><groupId>c3p0</groupId><artifactId>c3p0</artifactId><version>0.9.1.2</version><type>jar</type><scope>compile</scope></dependency><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>1.6.1</version><type>jar</type><scope>compile</scope></dependency><dependency><groupId>log4j</groupId><artifactId>log4j</artifactId><version>1.2.16</version><scope>compile</scope></dependency><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-log4j12</artifactId><version>1.6.1</version><type>jar</type><scope>compile</scope></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-orm</artifactId><version>3.2.2.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-aspects</artifactId><version>3.2.2.RELEASE</version></dependency><dependency><groupId>org.apache.struts</groupId><artifactId>struts2-spring-plugin</artifactId><version>2.3.1.2</version></dependency><dependency><groupId>org.apache.struts</groupId><artifactId>struts2-json-plugin</artifactId><version>2.3.1.2</version></dependency><dependency><groupId>org.hibernate</groupId><artifactId>hibernate-core</artifactId><version>3.6.10.Final</version></dependency><dependency><groupId>javassist</groupId><artifactId>javassist</artifactId><version>3.12.1.GA</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.25</version></dependency><dependency><groupId>org.apache.tomcat</groupId><artifactId>servlet-api</artifactId><version>6.0.33</version><type>jar</type><scope>provided</scope></dependency><dependency><groupId>org.codehaus.jackson</groupId><artifactId>jackson-mapper-asl</artifactId><version>1.9.3</version><type>jar</type><scope>compile</scope></dependency><dependency><groupId>org.codehaus.jackson</groupId><artifactId>jackson-core-asl</artifactId><version>1.9.3</version><type>jar</type><scope>compile</scope></dependency><dependency><groupId>commons-lang</groupId><artifactId>commons-lang</artifactId><version>2.6</version><type>jar</type><scope>compile</scope></dependency><dependency><groupId>org.apache.velocity</groupId><artifactId>velocity</artifactId><version>1.7</version></dependency><dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><version>1.2</version><type>jar</type><scope>compile</scope></dependency><dependency><groupId>commons-beanutils</groupId><artifactId>commons-beanutils</artifactId><version>1.8.3</version></dependency></dependencies></project>

 

 

9.4 项目中目录的变化

9.5 创建SSM项目,SSM项目依赖一下SSH项目

 创建项目

 

9.6 修改pom文件

 

<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>SSM</groupId><artifactId>SSM</artifactId><version>0.0.1-SNAPSHOT</version><packaging>war</packaging><name>SSM</name><description/><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>SSH</groupId><artifactId>SSH</artifactId><version>0.0.1-SNAPSHOT</version></dependency></dependencies></project>

 

10 项目的打包

首先使用maven命令或者是eclipse里的maven,把项目打包成为war,war包的存放目录,是在我们资源库里

 

10.1 war包的部署

 

打包成为war包以后

 

war包放到我们tomcat/webapps

 

启动tomcat服务器

 

Tomcat服务器会自动解压这个war

 

把服务器关了以后,war删除

 

可以直接使用浏览器

 

访问 http://localhost:8080/SSH-0.0.1-SNAPSHOT/

10.2 企业级项目开发

最终程序员需要把文件打包成为war,发布到tomcat服务器端.

 

 

转载于:https://www.cnblogs.com/JBLi/p/10562183.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/363407.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

vue动画

vue 提供了一些显示、隐藏一些不同的过渡&#xff0c;效果主要跟 v-if v-show 动态组件 1. vue 给动画分了 6 个过程&#xff0c;在 css 中扮演 6 个类 .v-enter  定义动画的开始状态 .v-enter-active  定义动画生效时的状态 .v-enter-to  定义动画结束是的状态 .v-leave…

基于AngularJS的Onsen UI --Onsen UI学习笔记

AngularJS与Onsen UI的结合&#xff0c;Onsen UI应用程序实际上是一个AngularJS 1应用程序。 <!doctype html><html lang"en"><head> <meta charset"utf-8"> <link rel"stylesheet" href"lib/onsen/css/…

图数据库的知识表示与推理

图形数据库及其技术生态系统可以为知识表示和推理问题提供优雅&#xff0c;有效的解决方案。 要了解这种说法&#xff0c;我们必须首先了解什么是图形。 图是一种数据结构。 图数据结构的类型很多&#xff0c;但出于本文的目的&#xff0c;我们将重点介绍一种已被称为属性图的类…

解决win2003安装exchangeServer后关机慢的方法

在windows2003上安装exchange2003&#xff08;或者是exchange2000&#xff09;后&#xff0c;很多用户发现服务器关闭变得非常之慢……很不幸的是&#xff0c;我也遇到了这个问题。从日志中的错误信息来分析&#xff0c;和目录服务先于某些服务终止有关。在微软的KB上查了一下&…

vegas 为盖斯

vegas 为盖斯 S键 分割素材U键 分开视频和音频I键渲染开始O渲染结束 默认布局 为盖斯新建项目的参数 剪好后渲染 插入字幕 转载于:https://www.cnblogs.com/GaoNa/p/10562504.html

简单配置 docker swarm

简单配置 docker swarm #准备三台CentOS7 #IP划分 192.168.1.201 virtualBox1 192168.1.202 virtualBox2 192168.1.204 virtualBox3 #三台机器上分别安装docker docker安装 #三台机器上分别配置加速器 vim /etc/docker/daemon.json #该文…

css图片的全屏显示代码-css3

<!DOCTYPE html><html lang"en">  <head>     <meta charset"UTF-8">     <title>Title</title>     <style type"text/css" rel"stylesheet">       *{margin: 0;pad…

COMET彗星(三)构建自己的COMET核心

主题列表&#xff1a; COMET彗星&#xff08;一&#xff09;SERVER PUSH介绍 COMET彗星&#xff08;二&#xff09;基于SERVER PUSH的消息传输 引言&#xff1a; 在上一篇随笔中&#xff0c;对COMET使用的类和作用进行了简短的介绍&#xff0c;从本篇随笔开始&#xff0c;将从实…

如何在JavaServer Pages中使用Salesforce REST API

摘要&#xff1a;本教程提供了一个JSP示例以及如何将其与Salesforce REST API集成。 我们将逐步完成创建外部客户端以使用Force.com &#xff08;同时使用HTTP&#xff08;S&#xff09;和JSON&#xff09;管理您的数据的分步过程。 在此示例中&#xff0c;我将Mac OS X 10.9.…

写在08年“愚人节”

从博客园学了很多东西&#xff0c;是时候该回馈了。谢谢博客园给我们提供这么好的平台交流技术。 刚发了文章习惯性的看了下自己博客的首页代码&#xff0c;感觉日历不够精良。 我做过的一个ajax日历&#xff0c;可以参考解放日报 艺术家具版的日期直达功能的日历&#xff0c;用…

19.3.20 解决pycharm快捷键无法使用问题和熟悉git与码云操作流程

problem&#xff1a;由于Vim插件导致快捷键无法使用&#xff1b; answer&#xff1a;settings→Plugins→搜索到ideaVim→取消选中→apply→重启pycharm&#xff1b; git&#xff1a;创建仓库→生成公钥&#xff08;ssh-keygen -t rsa -C "962891994qq.com"&#xff…

JQuery实现点击按钮切换图片(附源码)--JQuery基础

JQuery实现切换图片相对比较简单&#xff0c;直接贴代码了哈&#xff0c;有注释噢&#xff01;疑问请追加评论哈&#xff0c;不足之处还请大佬们指出&#xff01; 1、案例代码&#xff1a; demo.html&#xff1a; <!DOCTYPE html><html><head>   <me…

Java EE陷阱#1:忽略@Singleton的默认锁定

EJB Singleton Bean是EJB 3.1规范引入的&#xff0c;通常用于存储缓存的数据。 这意味着&#xff0c;我们尝试通过使用Singleton来提高应用程序的性能。 总的来说&#xff0c;这很好。 特别是在并行调用不多的情况下。 但是&#xff0c;如果我们忽略默认锁&#xff0c;并且并行…

js左右对联

相当着急的找了一早上&#xff0c;幸好有原来的代码作为基础&#xff0c;不害怕。<script>function initEcAd() {document.all.AdLayer1.style.posTop -200;document.all.AdLayer1.style.visibility visibledocument.all.AdLayer2.style.posTop -200;document.all.AdL…

cocos2d-x 横屏、竖屏(以及基于传感器)、读写sd卡

一、横屏、竖屏设置&#xff08;以及基于传感器的&#xff09; AndroidManifest.xml文件中&#xff0c; 1、不论任何情况的&#xff1a; screenOrientation"landscape" 为横屏 screenOrientation"portrait"为竖屏 …

CSS3盒子模型

web前端必须了解的CSS3盒子模型 1、需要了解的属性以及属性值 display:box或者display:inline-box box-orient:horizontal | vertical (水平 垂直) 定义盒模型的布局方向 box-direction:normal reverse(正序 反序) 元素排列顺序 box-ordinal-group:number(数值) 设置元素…

与JBoss Fuse,Jenkins和Nexus的持续集成

最近&#xff0c;我正在整理一个快速启动的Maven项目&#xff0c;以展示一种组织JBoss Fuse项目的可行方法。 该项目可在Github上找到&#xff1a; https &#xff1a; //github.com/paoloantinori/fuse_ci 这是我与朋友詹姆斯罗林斯 &#xff08; James Rawlings&#xff09…

回家

好啦&#xff0c;搞笑的2008年过去了&#xff0c;拿完年终奖&#xff0c;回家过年吧。 去年这个年还真有意思&#xff0c;先有冰冻&#xff0c;后有地震&#xff0c;还有奥运。 好的也有&#xff0c;坏的也有&#xff0c;不过不管怎么样&#xff0c;我们还是撑过来了。 08年也没…

HDFS优缺点

HDFS架构简述 一、HDFS简介 HDFS&#xff08;Hadoop distributed File System&#xff09;&#xff1a;Hadoop分布式文件系统。是基于流数据模式访问和处理超大文件的需要而开发的&#xff0c;可以运行于廉价的服务器上。它所具有的高容错&#xff0c;高可靠性&#xff0c;高可…

Python学习_线程Thread学习 GIL锁 队列queue 线程池

进程和线程的目的&#xff1a;提高执行效率IO操作利用极少量CPUIO密集型(不用CPU)&#xff1a;多线程计算密集型(用CPU)&#xff1a;多进程1、单进程单线程&#xff0c;主进程&#xff0c;主线程2、自定义线程&#xff1a; 主进程&#xff1a; 主线程 子线程进…