Maven配置备忘

一、使用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.jar

mvn 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/



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值