GitLab Conventions
The no.tritt.gitlab-conventions
plugin configures GitLab Maven repositories.
If you provide a gitlabProjectId
it also configures a repository for publishing.
Configure
plugins {
id 'java'
id 'no.tritt.gitlab-conventions' (1)
}
repositories { (2)
mavenCentral() // needed due to transitive micronaut-bom dependency
}
dependencies {
compileOnly 'no.tritt:tritt-problem-json-api:+'
}
gitlabRepositories {
trittOpen { (3)
groupId '12992043'
}
trittProblemJson { (4)
projectId '31009252'
}
}
tasks.register('listRepositories') { t ->
t.doLast {
repositories.each { MavenArtifactRepository repo ->
println "${repo.name} -> ${repo.url}"
}
}
}
1 | apply the plugin |
2 | adds a repository because of gitlabGroupId from gradle.properties |
3 | adds a named group repository using groupId |
4 | adds a named project repository using projectId |
gradle.properties
gitlabGroupId=12992043
gitlabProjectId=30547514
Tritt Configuration
build.gradle
repositories {
maven gitlab.tritt() (1)
maven gitlab.trittOpen() (2)
}
1 | add Tritt repository using convenience method |
2 | add TrittOpen repository using convenience method |
List repositories
build.gradle
> gradle listRepositories
MavenRepo -> https://repo.maven.apache.org/maven2/
GitLab -> https://gitlab.com/api/v4/groups/12992043/-/packages/maven
TrittOpen -> https://gitlab.com/api/v4/groups/12992043/-/packages/maven
TrittProblemJson -> https://gitlab.com/api/v4/projects/31009252/packages/maven