Maven配置备忘

来源:互联网 发布:js获取数组前几个元素 编辑:程序博客网 时间:2024/06/05 06:27

一、使用Tomcat来跑应用

<build><plugins><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>${tomcat7-maven-plugin.version}</version><!-- http://tomcat.apache.org/maven-plugin-2.1/run-mojo-features.html --><configuration><contextReloadable>true</contextReloadable><systemProperties><spring.profiles.default>test</spring.profiles.default></systemProperties><!-- if you want to use test dependencies rather than only runtime --><useTestClasspath>true</useTestClasspath></configuration></plugin></plugins></build>


二、使用项目中的lib包,注意scope和${project.basedir}
<dependency><groupId>com.ebiz</groupId><artifactId>ebiz-ssi-mysql</artifactId><version>1.3</version><scope>system</scope><systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/ebiz-ssi-mysql-1.3.jar</systemPath></dependency>


三、Deploy依赖到nexus第三方库

1.将deployment用户密码设置为deployment

2.库的设置成可以Redeploy

3.settings.xml servers节点加上以下配置

    <server>        <id>thirdparty</id>        <username>deployment</username>        <password>deployment</password>      </server> 

install 或 deploy依赖到第三方库

mvn install:install-file -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dfile=sqljdbc4.jarmvn deploy:deploy-file -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dfile=sqljdbc4.jar -DrepositoryId=thirdparty -Durl=http://nexus:8081/nexus/content/repositories/thirdparty/



原创粉丝点击