The version of the Gradle requires to match TK-Maven's version.
TK-Maven | Support Gradle version |
Support Android build tools |
---|---|---|
3.0.0+ | >= 7.0.0 | >= 7.0.0 |
2.2.1+ | >= 6.0.0 | >= 4.0.0 |
1.0.0+ | <= 5.6.4 | <= 3.6.3 |
Add the TK-Maven to your buildscript
:
buildscript {
dependencies {
// TK-Maven 工具
classpath 'cn.shper.plugin:tk-maven:3.0.0'
}
}
Add the tkmaven extension to your build.gradle
:
apply plugin: 'tk-maven'
tkmaven {
groupId = "cn.shper.plugin"
artifactId = "tk-maven"
version = "1.0.0"
repository {
url = "https://maven.shper.cn/repository/release"
sourcesJar = false
javadocJar = true
}
snapshotRepository {
url = "https://maven.shper.cn/repository/snapshots"
sourcesJar = true
javadocJar = true
}
}
Add the your username and password to your local.properties
or ~/.gradle/gradle.properties
:
# Maven's username and password
tk-maven.userName=XXX
tk-maven.password=XXX
Add the your username and password to tkmaven:
tkmaven {
// ......
repository {
userName = "XXX"
password = "XXX"
// ......
}
snapshotRepository {
userName = "XXX"
password = "XXX"
// ......
}
Start to publish you library to repository.
Use the command to publish the library
Publish to maven repository.
./gradlew publishMaven -PuserName=<&USER_NAME> -Ppassword=<&PASSWORD>
Copyright 2022 Shper
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.