maven备忘
maven常见命令
mvn clean
mvn compile
mvn package
mvn clean compile package
mvn -Djetty.port= jetty:run
mvn -Djetty.port= jetty:run
mvn clean compile -Djetty.port= jetty:run
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc 命令使用方法:
首先进入到相应的pom.xml目录中,然后执行以上命令:
第一个命令是尝试下载在pom.xml中依赖的文件的源代码。
第二个命令:是尝试下载对应的javadocs
但是有可能一些文件没有源代码或者javadocs
单元测试覆盖率
单元测试Cobertura
<!-- 单元测试覆盖率插件 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-</encoding>
<formats>
<format>html</format>
<format>xml</format>
</formats>
</configuration>
</plugin>
单元测试代码编写完成,所有设置配制好后,在工程根目录运行“mvn cobertura:cobertura”Maven 就会对代码进行编译
编译完成之后,就会在项目中运行测试代码并输出测试报告结果到目录 project_base$\target\site\cobertura\index.html
目标指令 作用解释
cobertura:check 检查最后一次标注(instrumentation) 正确与否
cobertura:clean 清理插件生产的中间及最终报告文件
cobertura:dump-datafile Cobertura 数据文件 dump 指令 , 不常用
cobertura:instrument 标注编译好的 javaclass 文件
cobertura:cobertura 标注、运行测试并产生 Cobertura 覆盖率报告
maven 插件
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Dfile.encoding=UTF-</argLine>
<!--打包时是否略过测试 -->
<!--<skip>true</skip> -->
<!--测试出现错误时是否忽略,如果为true,则会直接打包 -->
<!--<testFailureIgnore>true</testFailureIgnore> -->
</configuration>
<version>2.17</version>
</plugin>
<!--maven jetty 插件配置 -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1..v20140903</version>
<configuration>
<webApp>
<contextPath>${jetty.context}</contextPath>
</webApp>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port></port>
</connector>
</connectors>
<stopKey>jetty</stopKey>
<stopPort></stopPort>
</configuration>
</plugin>
</plugins>
</pluginManagement>
tomcat 插件
<!-- tomcat6 插件-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<path>/wp</path>
<port></port>
<uriEncoding>UTF-</uriEncoding>
<url>http://localhost:8080/manager/html</url>
<server>tomcat6</server>
</configuration>
</plugin>
<!-- tomcat7 插件-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<port></port>
<path>/mgr</path>
<uriEncoding>UTF-</uriEncoding>
<finalName>mgr</finalName>
<server>tomcat7</server>
</configuration>
</plugin> path 是访问应用的路径
port 是tomcat 的端口号
uriEncoding URL按UTF-8进行编码,这样就解决了中文参数乱码。
Server 指定tomcat名称。 命令 描述
tomcat:deploy 部署一个web war包
tomcat:reload 重新加载web war包
tomcat:start 启动tomcat
tomcat:stop 停止
tomcat:run 启动嵌入式tomcat ,并运行当前tomcat
tomcat:undeploy 停止一个war包项目
maven备忘的更多相关文章
- GIS部分理论知识备忘随笔
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.高斯克吕格投影带换算 某坐标的经度为112度,其投影的6度带和3度带 ...
- python序列,字典备忘
初识python备忘: 序列:列表,字符串,元组len(d),d[id],del d[id],data in d函数:cmp(x,y),len(seq),list(seq)根据字符串创建列表,max( ...
- Vi命令备忘
备忘 Ctrl+u:向文件首翻半屏: Ctrl+d:向文件尾翻半屏: Ctrl+f:向文件尾翻一屏: Ctrl+b:向文件首翻一屏: Esc:从编辑模式切换到命令模式: ZZ:命令模式下保存当前文件所 ...
- ExtJs4常用配置方法备忘
viewport布局常用属性 new Ext.Viewport({ layout: "border", renderTo: Ext.getBody(), defaults: { b ...
- [备忘] Automatically reset Windows Update components
这两天遇到Windows 10的更新问题,官方有一个小工具,可以用来修复Windows Update的问题,备忘如下 https://support.microsoft.com/en-us/kb/97 ...
- ECMAScript 5(ES5)中bind方法简介备忘
一直以来对和this有关的东西模糊不清,譬如call.apply等等.这次看到一个和bind有关的笔试题,故记此文以备忘. bind和call以及apply一样,都是可以改变上下文的this指向的.不 ...
- MFC通过txt查找文件并进行复制-备忘
MFC基于对话框的Demo txt中每行一个23位的卡号. 文件夹中包含以卡号命名的图像文件.(fpt或者bmp文件) 要求遍历文件夹,找到txt中卡号所对应的图像文件,并复制出来. VC6.0写的. ...
- php 相关模块备忘
在安装php的时候,不管是编译安装: ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc -- ...
- 『备忘』HttpWebRequest 在 POST 提交时, 标头(Headers)丢失原因
近来研究 HttpWebRequest —— 辅助类完成时,POST JSON数据 总会 丢失标头(Headers). HttpWebRequest POST JSON数据,分如下几步: > 将 ...
随机推荐
- How to extract msu/msp/msi/exe files from the command line
http://www.windowswiki.info/2009/02/19/how-to-extract-msumspmsiexe-files-from-the-command-line/ Micr ...
- Visual Studio for mac从入门到放弃1
MAC 第一步:从微软官网下载:https://www.visualstudio.com/vs/visual-studio-mac/ 第二步:安装软件过程出现 It was not possible ...
- CSS3 线性渐变linear-gradient
CSS3 Gradient 分为 linear-gradient(线性渐变)和 radial-gradient(径 向渐变).为了更好的应用 CSS3 Gradient,需要先了解一下目前的几种现代浏 ...
- xml写入
XmlDocument xmlDocument=new XmlDocument(); XmlElement root = xmlDocument.CreateElement("", ...
- 自己从0开始学习Unity的笔记 VIII (C#中类继承练习 II)
自己写了一个关于兵种的,因为一直在测试,到底面向对象是个什么玩意...然后就做了这个 namespace 兵种 { class Role //作为父类,构建一个普通角色属性用于继承 { protect ...
- python中的内置函数,递归,递归文件显示(二),二分法
1.部分内置函数 repr()显示出字符串的官方表示形式,返回一个对象的string形式 # repr 就是原封不动的输出, 引号和转义字符都不起作用 print(repr('大家好,\n \t我叫周 ...
- 20165219 Exp1 PC平台逆向破解
20165219 Exp1 PC平台逆向破解 实践目标 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函数会简单回显任何用户输入的字符串 ...
- 如何获取token值
登录的时候需要拿到token值,需要跟后端配合才能拿到 官方说明: https://developers.weixin.qq.com/miniprogram/dev/api/api-login.htm ...
- MySQL之LIMIT用法
http://blog.163.com/niuxiangshan@126/blog/static/17059659520101081058299/ 看的人家的 mysql支持limitselect * ...
- 定期删除Azure存储账号下N天之前的数据文件-ARM
######RemoveStorageBlob*DaysOld-ARM##### <# .SYNOPSIS Remove all blob contents from one storage a ...