maven的使用
来源:互联网 发布:2013版excel数据在哪里 编辑:程序博客网 时间:2024/05/21 09:45
maven编译时使用的字符集设定
因为在java代码中,有可能包含中文,日文等注释,如果不设定相应的encoding方式,编译过程中会出现问题。
为了避免编译出错,可在父POM.xml文件中定义如下内容。
<build> <pluginManagement><plugins> <plugin> <groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration> <encoding>utf-8</encoding> <source>1.6</source> <target>1.6</target></configuration> </plugin></plugins> </pluginManagement></build>
发布组件到远程仓库管理器(Nexus)
1)配置setting.xml的server情报
<servers><server> <id>releases</id> <username>admin</username> <password>xxxxxxxxx</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>xxxxxxxxx</password> </server> </servers>
2)配置pom.xml文件的SCM信息
<distributionManagement> <repository> <id>releases</id> <name>Nexus Managed Releases Repository</name> <url>http://192.168.0.55:8081/nexus/content/repositories/releases</url> <layout>default</layout> </repository> <snapshotRepository> <id>snapshots</id> <name>Nexus Managed Snapshots Repository</name> <url>http://192.168.0.55:8081/nexus/content/repositories/snapshots</url> <uniqueVersion>true</uniqueVersion> <layout>default</layout> </snapshotRepository> </distributionManagement>
3)在Nexus中配置release和snapshortsRepository。
4)在maven项目中运行mvn deploy就能发布到远程仓库中去了。
mybatis源码导出,通过eclipse导入maven项目可以checkout出Mybatis的源码进行分析,学习。
http://mybatis.googlecode.com/svn/sub-projects/mybatis-parent/trunk/
http://mybatis.googlecode.com/svn/trunk/
maven生成ear的方法
maven打包生成ear文件的方式<plugin><artifactId>maven-ear-plugin</artifactId><version>2.3.2</version><configuration><finalName>Advisor</finalName><version>5</version><generatedDescriptorLocation>${basedir}/src/main/application/META-INF</generatedDescriptorLocation><modules> <webModule><groupId>cn.tradewin.advisor</groupId><artifactId>AdvisorWeb</artifactId><uri>AdvisorWeb.war</uri><bundleFileName>AdvisorWeb.war</bundleFileName><contextRoot>/advisor</contextRoot> </webModule></modules><defaultLibBundleDir>/lib</defaultLibBundleDir></configuration></plugin>
maven打包方式
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-dependencies</id> <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> <mainClass>theMainClass</mainClass> </manifest> </archive> </configuration> </plugin>
- 【Maven】Maven的简单使用
- maven的初级使用
- maven的使用
- maven 的使用
- maven使用的总结
- maven的使用
- Maven的使用
- maven的使用
- maven的使用
- Maven的使用
- maven的使用
- Maven的本地使用
- maven的简单使用
- Maven的使用
- 使用maven的好处
- maven的使用
- Maven 的使用
- Maven的使用
- 动态规划思想
- 记录:自定义设置颜色静态控件的实现
- myeclipse的常用技巧
- 针对《关于郝培强的《为什么我们招聘的时候绝不要传智播客的学生?》》的看法
- Tomcat中各组件介绍
- maven的使用
- Webdav 命令
- 经典排序之选择、冒泡、插入排序与系统排序的用时比较(Java)
- fedora torque pbs install
- Tomcat ClassLoader机制介绍
- 2012-01-08
- c语言宏定义技巧
- 学习《Real Time Rendering》后自己实现的代码
- Tomcat Connector组件