15) maven dependency scope
Dependency Scope
Dependency scope is used to limit the transitivity of a dependency, and also to affect the classpath used for various build tasks.
There are 6 scopes available:
- compile
This is the default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects. - provided
This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive. - runtime
This scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath. - test
This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. - system
This scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository. - import (only available in Maven 2.0.9 or later)
This scope is only used on a dependency of type pom in the <dependencyManagement> section. It indicates that the specified POM should be replaced with the dependencies in that POM's <dependencyManagement> section. Since they are replaced, dependencies with a scope of import do not actually participate in limiting the transitivity of a dependency.
15) maven dependency scope的更多相关文章
- Maven Dependency Scope用法
原帖地址:http://uule.iteye.com/blog/2087485 官方API描述 Dependency scope 是用来限制Dependency的作用范围的, 影响maven项目在各个 ...
- Maven Dependency Scope
官方API描述 Dependency scope 是用来限制Dependency的作用范围的, 影响maven项目在各个生命周期时导入的package的状态. 自从2.0.9后,新增了1种,现在有了 ...
- Maven的dependency scope属性
官方地址:https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependen ...
- Maven学习----Dependency scope
首先官网API 2.09版本之后,有6中scope. Dependency scope 用来限制依赖的作用范围,同时也作用于各种编译路径类路径,下面详细说明这六种路径: compile这是默认范围,C ...
- Dependency Scope
Dependency Scope <dependency>中还引入了<scope>,它主要管理依赖的部署.目前<scope>可以使用5个值: * compile,缺 ...
- Maven依赖Scope标签用法
在一个maven项目中,如果存在编译需要而发布不需要的jar包,可以用scope标签,值设为provided.如下: <dependency> <groupId ...
- maven中scope属性的
Dependency Scope 在POM 4中,<dependency>中还引入了<scope>,它主要管理依赖的部署.目前<scope>可以使用5个值: * c ...
- maven中scope
scope maven中scope的默认值是compilescope的分类1)compile 默认是compile.compile表示被依赖项目需要参与当前项目的编译,包括后续的测试,运行周期也参与其 ...
- Maven错误Failed to read artifact descriptor for xxx:jar 和 missing artifact maven dependency
可参考:http://stackoverflow.com/questions/6111408/maven2-missing-artifact-but-jars-are-in-place http:// ...
随机推荐
- HQL中的Like查询需要注意的地方
public List getOrgan(String organCode, String organName) { String hsql; List list; if (organCo ...
- Haskell语言学习笔记(32)Data.Maybe, Data.Either
Data.Maybe Prelude Data.Maybe> maybe "" show (Just 5) "5" Prelude Data.Maybe& ...
- sessionpage1
session1 <%@page import="java.text.SimpleDateFormat"%> <%@ page language="ja ...
- javascript中的二维数组
要创建一个二位数组我们脑子里第一个出现的就是 var arr=[][]; 但是在javascript这样是会报错的,要在javascrip中创建一个二位数组对象方法如下 方法一 直接把数组写出 ...
- rook 记录
更改rook 集群的配置 https://github.com/rook/rook/blob/master/design/cluster-update.md rook集群升级流程 https://ro ...
- KEGG下载某物种最新的版本信息(斑马鱼为例)
步骤一:打开链接并选择物种 http://www.genome.jp/kegg-bin/get_htext?hsa00001+3101 步骤二:对文件进行解析 步骤三:统计信息 一级结构(6大类): ...
- spring学习笔记(三)
spring jdbc spring tx 1.spring的jdbc模板 Spring提供了很多持久层技术的模板类简化编程: 1.1.jdbc模板的基本使用 @Test // JDBC模板的基本使用 ...
- 数据库事务(Database Transaction)
事务(Transaction)是访问并可能更新数据库中各种数据项的一个程序执行单元(unit).事务由事务开始(begin transaction)和事务结束(commit transaction或 ...
- python之用户登陆作业
实现一个用户登陆的小程序,如果密码错误,可以重试三次,如果三次均错误,则锁定 数据库如下格式,分别用户名|密码|锁定,其中锁定字段0为正常,1为被锁定 root|admin123|0 admin|ad ...
- iOS - 上架的APP 生成二维码下载
1.首先打开苹果App Store商店进入到里面,找到需要打开链接地址的应用程序,例如:百度. 2. 在App Store商店里面先点击一下应用程序图标,再按一下…分享按钮. 3. 接着选择分享APP ...