首页 > 编程知识 正文

android gradle教程,buildgradle美化插件

时间:2023-05-04 12:17:26 阅读:9966 作者:4753

为了消除XML (如ANT和Maven )的麻烦配置,Gradle使用基于Groovy的域特定语言(DSL,Demain Specific Language )声明了项目设置。

插入我的eureka服务的项目结构图

构建脚本: build.gradle,需要注意的是,脚本内容的执行具有优先级,通常是buildscript-plugins-repositories-dependencies-dependency mm

buildscript { repositories } maven { URL ' https://maven.a liyun.com/nexus/content/groups/public ' } ependencies { class path ' org.spring framework.boot : spring-boot-grad le-plugin :2.4.5 ' } plugins { id ' org.spring framework.boot ' version '2.4.5' id ' io.spring.dependency-management ' version '1. 1。 URL ' https://maven.a liyun.com/nexus/content/go ntent ' 2020.0.2 ependencies { implementation ' org.spring framework.cloud : spring-cloud-starter-Netflix-euuuu or'implementation'com.github .传统串行- manes.caffeine 3360 caffeine 33602.8 ' } ependencymanagement { imports } maven BOM ' org.spring framework.cloud 3360 spring-cloud-dependencies 3360 $ { spring cloud }构建脚本- buildscriptbuildscrioud maven { URL ' https://maven.a liyun.com/nexus/content/groups从何处构建下一个构建插件*/class path ' org.spring framework

根据项目的不同,有相应的构建插件

其中repositories指定仓库的位置,dependencies指定插件的类型和版本

2、插件-插件插件{ id ' org.spring framework.boot ' version '2.4.5' id ' io.spring.dependency-management

id 'org.springframework.boot '引入了springboot插件,可以运行与springboot项目相关的task命令

id ' io.spring.dependency-management '引入了执行依赖关系指令的依赖关系管理插件

id 'java '引入了Java插件,可以支持Java编译、运行和打包等task指令

3、仓库- repositories repositories { maven { URL ' https://maven.a liyun.com/nexus/content/groups/public ' }指定项目的Jar

例如,蚂蚁镜像: maven { URL ' https://maven.a liyun.com/nexus/content/groups/public ' }

4, 依赖于-从属关系从属关系{ implementation ' org.spring framework.cloud 3360 spring-cloud-starter-Netflix-eureka fig ' implementation ' org.spring framework.cloud 3360 spring-cloud-starring amework.boot 3360 spring-boot-starter-wwwot 60 spring-boot-starter-rk.boot 3360 spring-boot-starter-JDBC ' implementation ' com.Bao midou 3360 my batis-plus-plus mple mentation ' org.Apache.commons 3360 commons-pool2' implementation ' MySQL 3360 MySQL

implementation是springboot插件提供的task命令,用于指定从编译、打包到运行范围的整个过程(如maven的范围节点)都是有效的

可以在groupid artifact id版本中指定特定的依赖关系

也可以使用implementationgroupid ' com.Bao midou ' artifact id ' my batis-plus-boot-starter ' version '3.1.0'

implementation ' com.Bao midou : my batis-plus-boot-starter :3.1.0 ' 5,依赖关系管理-从属关系管理maven BOM ' org.spring framework.cloud 3360 spring-cloud-depend dent ' }如果此块主要是依赖关系管理的,并且它涉及多模块、父子模块,则希望你记住,这个地方不引入依赖关系,只要事先定义,就不需要在各个模块上写版本号。 例如,上述从属关系中的依赖关系是springboot“

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。