maven scope,provided和compile区别,optional,classifier,systemPath等用法介绍

maven生命周期介绍

编译(mvn compile)
测试(mvn test-compile和mvn test)
打包(mvn package和mvn install和mvn deploy)
运行(mvn exec)

scope介绍

compile

默认scope,参与编译、测试、打包、运行。

test

仅参与测试。

runtime

参与打包与运行,但不参与编译(也就是在开发时不能直接用,只能通过反射才能使用,常用于jdbc实现库)。

provided

参与编译、测试、运行,但不会被打包进jar或war(也就是说,运行时由别人提供,常用于应用服务器已经提供的库,如jsp相关库、servlet相关库)。

system

与compile相同,但不从maven仓库中下载,而是从systemPath属性进行获取。
必须配合systemPath属性一起使用。

import

只在dependencyManagement的中使用,能解决maven单继承问题,import依赖关系实际上并不参与限制依赖关系的传递性。

systemPath介绍

必须配合<scope>system</scope>使用
示例:

<dependency>
			<groupId>com.aliyun</groupId>
			<artifactId>aliyun-java-sdk-core</artifactId>
			<version>4.1.0</version>
			<scope>system</scope>
			<systemPath>${project.basedir}/lib/aliyun-java-sdk-core-4.1.0.jar</systemPath>
		</dependency>

${project.basedir}表示项目根目录。

optional介绍

当该依赖成为间接依赖时,是否让该依赖不成为强制依赖。
例如,a依赖b,b依赖c,
在b项目中,使用optional为true方式依赖c,那么a项目打包时,可选是否打包c,
如果b项目中,使用optional为false方式依赖c,那么a项目打包时,必须将c打包进去。

classifier介绍

指定使用哪个版本的jdk来编译此依赖。

<classifier>jdk15</classifier>

exclusions和exclusion介绍

剔除当前依赖中指定的依赖。

<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<exclusions>
				<!-- 剔除logging -->
				<exclusion>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-logging</artifactId>
				</exclusion>
				<!-- 剔除tomcat -->
				<exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion>
			</exclusions>
		</dependency>
;/*********************** (C) COPYRIGHT 2010 Libraworks ************************* ;* File Name : os_cpu_a.asm ;* Author : Librae ;* Version : V1.0 ;* Date : 06/10/2010 ;* Description : ¦ÌCOS-II asm port for STM32 ;*******************************************************************************/ IMPORT OSRunning ; External references IMPORT OSPrioCur IMPORT OSPrioHighRdy IMPORT OSTCBCur IMPORT OSTCBHighRdy IMPORT OSIntNesting IMPORT OSIntExit IMPORT OSTaskSwHook EXPORT OSStartHighRdy EXPORT OSCtxSw EXPORT OSIntCtxSw EXPORT OS_CPU_SR_Save ; Functions declared in this file EXPORT OS_CPU_SR_Restore EXPORT PendSV_Handler NVIC_INT_CTRL EQU 0xE000ED04 ; ÖжϿØÖƼĴæÆ÷ NVIC_SYSPRI2 EQU 0xE000ED20 ; ϵͳÓÅÏȼ¶¼Ä´æÆ÷(2) NVIC_PENDSV_PRI EQU 0xFFFF0000 ; PendSVÖжϺÍϵͳ½ÚÅÄÖÐ¶Ï ; (¶¼Îª×îµÍ£¬0xff). NVIC_PENDSVSET EQU 0x10000000 ; ´¥·¢Èí¼þÖжϵÄÖµ. PRESERVE8 AREA |.text|, CODE, READONLY THUMB ;******************************************************************************************************** ; CRITICAL SECTION METHOD 3 FUNCTIONS ; ; Description: Disable/Enable interrupts by preserving the state of interrupts. Generally speaking you ; would store the state of the interrupt disable flag in the local variable 'cpu_sr' and then ; disable interrupts. 'cpu_sr' is allocated in all of uC/OS-II's functions that need to ; disable interrupts. You would restore the interrupt disable state by copying back 'cpu_sr' ; into the CPU's status register. ; ; Prototypes : OS_CPU_SR OS_CPU_SR_Save(void); ; void OS_CPU_SR_Restore(OS_CPU_SR cpu_sr); ; ; ; Note(
03-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值