gradle 使用本地maven 仓库 和 提交代码到maven
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* user guide available at https://docs.gradle.org/3.5.1/userguide/java_library_plugin.html
*/ // Apply the java-library plugin to add support for Java Library apply plugin: 'java-library'
apply plugin: 'maven-publish'
//只有group 和 version 可以编辑。。project.name 不能修改。。。
project.group="zkdg" project.version="0.1-SNAPSHOT" // In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
maven { url 'file:///E:/whm/repository/'} //使用file协议,本地仓库
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'} // jcenter()
} dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1' // This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:21.0'
compile 'emark:emark-manager:0.0.1-SNAPSHOT'
compile 'org.springframework:spring-context:4.3.9.RELEASE'
// Use JUnit test framework
testImplementation 'junit:junit:4.12' } //maven-publish 插件 提交到本地仓库
publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.name
version project.version
//若是war包,就写components.web,若是jar包,就写components.java
from components.java
}
}
repositories {
maven { if (project.version.endsWith('-SNAPSHOT')) {
url = "file:///E:/whm/repository/"
} else {
url = "release版本的仓库地址"
} // credentials {
// username 'nexus仓库用户名'
// password 'nexus仓库密码'
// }
}
}
}
gradle publishMavenPublicationToMavenRepository 运行命令(如果失败,请去掉gradle)
令人蛋疼的是gradle 无法下载文件到maven 仓库。。。。而是以缓存 存在。。。真够不习惯的,我还是用maven 吧。。而且 gradle 网上资料也有点少----
不过gradle的语法真的很美,看起来很漂亮。。不过目前来说还不是很好用-----
gradle 使用本地maven 仓库 和 提交代码到maven的更多相关文章
- git远程仓库、提交代码操作
初始化仓库 1.初始化 git init #或 git clone 远程仓库地址 git init 后续要添加远程仓库,git clone不需要再添加 2.连接仓库 git remote add 远程 ...
- maven 动态版本 aliyun阿里云Maven仓库地址——加速你的maven构建
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
- Git仓库创建---克隆仓库---初始提交代码
1.在Git上创建仓库,添加成员,默认分支是“master”,仓库路径假设为http://192.168.1.1/root/project.git 2.在sourceTree上,点击“克隆”,输入上面 ...
- GIT 使用(二):创建仓库并提交代码
基本操作 所用命令使用 windows 下安装 git-bash 运行 Table of Contents 先决条件 已经安装了 GIT 客户端 已经设置用户信息 如果没做可以看安装和配置 获取 Gi ...
- git连接不上远程仓库---visualstudio提交代码报错:no upstream configured for branch 'master'
1,新建文件夹,在文件下下鼠标右键git bush--->git init,初始化仓库: 2,设置gitthub仓库地址:git remote add origin https://github ...
- 如何将本地git仓库中的代码上传到github
1, 在github上新建一个仓库,比如为:CSS3Test,仓库地址为:https://github.com/hyuanyuanlisiwei/CSS3Test 2,本地git仓库中的文件项目为C ...
- (转)如何将本地git仓库中的代码上传到github
1, 在github上新建一个仓库,比如为:CSS3Test,仓库地址为:https://github.com/hyuanyuanlisiwei/CSS3Test 2,本地git仓库中的文件项目为C ...
- 转:aliyun阿里云Maven仓库地址——加速你的maven构建
maven仓库用过的人都知道,国内有多么的悲催.还好有比较好用的镜像可以使用,尽快记录下来.速度提升100倍. http://maven.aliyun.com/nexus/#view-reposito ...
- aliyun阿里云Maven仓库地址——加速你的maven构建
maven仓库用过的人都知道,国内有多么的悲催.还好有比较好用的镜像可以使用,尽快记录下来.速度提升100倍. http://maven.aliyun.com/nexus/#view-reposito ...
随机推荐
- JAVA反射机制学习随笔
JAVA反射机制是用于在运行时动态的获取类的信息或者方法,属性,也可以用来动态的生成类,由于所有类都是CLASS的子类,我们可以用一个CLASS类的实例来实例化各种类 例如: Class<?&g ...
- java中的字符,字节和编码
1. 编码问题的由来,相关概念的理解 1.1 字符与编码的发展 从计算机对多国语言的支持角度看,大致可以分为三个阶段: 系统内码 说明 系统 阶段一 ASCII 计算机刚开始只支持英语,其它语言不 ...
- day17-jdbc 2.jdbc介绍
SQL是一种非过程性语言,只能写一条嘛,你写多条不行嘛.每个数据库都有自己的存储过程.你可以做编程,你可以写多条SQL语句把它放到一起.这就是存储过程.然后用的时候一调它就执行这个逻辑结构了.因为多条 ...
- [chmod]linux中给文件增加权限
chmod命令 1.chmod u+x file.sh 2.sudo chmod 777 文件名 注: 如果给所有人添加可执行权限:chmod a+x 文件名:如果给文件所有者添加可执行权限:chm ...
- STM32 C++编程 004 Adc (数模转换)类
使用 C++ 语言给 STM32 编写一个 Adc 类 我使用的STM32芯片:STM32F103ZET6 我们使用的STM32库版本:V3.5.0 注意: 想学习本套 STM32 C++编程 的专栏 ...
- linux sdcv命令
一.简介 sdcv全称为stardict console version,是终端下的词典. 二.安装 1)安装sdcv yum install -y sdcv 2)安装字典 http://www. ...
- linux删除文件、创建文件
1.删除文件 rm huahua.txt 2.创建文件 touch huahua.txt
- Bootstrap 组件之 Nav
一.简介 Nav 指导航页.这里 是一个线上例子. 使用了 .nav 的标签就是一个 Nav.下面举例. {注意} 记住,下面的几种导航页都依赖 .nav. 二.导航页 添加 .nav-tabs. & ...
- iOS应用推荐
RSS阅读器 Inoreader ***客户端 SuperWingy OpenWingy(已下架) 书签 Pocket 语音备忘录 Voice-Memos 编程语言学习 SoloLearn 社交 Tw ...
- 【android】setOnItemClickListener cannot be used with a spinner的错误
错误提示: java.lang.RuntimeException: Unable to start activity ComponentInfo{xx activity}: java.lang.Run ...