jdk 1.8+
gradle 2.14+
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.zxy</groupId>
<artifactId>zxy-commons-bom</artifactId>
<version>${zxy_commons_bom_version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
buildscript {
repositories {
maven {
url groupUrl
}
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
}
}
dependencyManagement {
imports {
mavenBom "com.zxy:zxy-commons-bom:${zxy_commons_bom_version}"
}
}
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
compile 'com.google.guava:guava'
这样能做到所有引用的项目不用指定版本号,所依赖的第3方组件版本号都在zxy-commons-bom项目中统一管理。
修改gradle.properties:
#snapshot地址
snapshotsUrl=
#release地址
releaseUrl=
#用户名
username=
#密码
password=
./gradlew publishToMavenLocal
./gradlew publish
- QQ: 442336467
- 微信: zhaoxunyong
- email: [email protected]