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 ...
随机推荐
- 简单cpu web flask mysql
转:http://blog.csdn.net/u010663768/article/details/60632133 python 2.7 cpu入库 #!/usr/bin/python # -*- ...
- C语言学习笔记--指针阅读技巧
1. 指针阅读技巧:右左法则 (1)从最里层的圆括号中未定义的标示符看起 (2)首先往右看,再往左看 (3)遇到圆括号或方括号时可以确定部分类型,并调转方向 (4)重复 2.3 步骤,直到阅读结束 注 ...
- java判断姓是否合格 千家姓
package com.sycx.domain; import java.lang.reflect.Array; public class FirstName { public static bool ...
- 关于service和线程的区别
主要有两方面,访问控制和功能区别 首先,service是运行在主线程上的,并不是一个新的线程 其次,service在运行的时候可以被多个activity访问和控制,而线程是不可以的 最后,servic ...
- POJ 3714 分治/求平面最近点对
第一次见这种问题直接懵圈...没想到分治法这么强大,借鉴了lyd的代码: 代码如下 #include<cstdio> #include<algorithm> #include& ...
- EZOJ #77
传送门 分析 一个比较神奇的思路 我们考虑分治,对于每一个区间[le,ri]我们计算这个区间中左端点属于[le,mid],右端点属于[mid+1,ri]的情况对答案的贡献 我们求左半个区间的最大最小值 ...
- hadoop运行故障问题解决1——datanode节点启动后自动关闭
ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Incompatible namespaceID ...
- java全栈day10--接口 多态
接口的概念 接口是功能的集合,同样可看做是一种数据类型,是比抽象类更为抽象的”类”. 接口只描述所应该具备的方法,并没有具体实现,具体的实现由接口的实现类(相当于接口的子类)来完成.这样将功能的定义与 ...
- Socket编程--并发server
Socket地址复用 int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); int ...
- JQuery UI Draggable插件使用说明文档
JQuery UI Draggable插件用来使选中的元素可以通过鼠标拖动.Draggable的元素受css: ui-draggable影响, 拖动过程中的css: ui-draggable-drag ...