Hi !
I’m trying to do a plugin that should be published to mavenLocal and some internal repository. But for some reason whenever I need to use it , it can’t as Gradle can’t find it.
On settings.gradle:
pluginManagement {
repositories {
mavenLocal()
maven {
url 'https://internalRepo.jfrog.io/xxxx'
credentials {
username artifactoryUser
password artifactoryPassword
}
}
gradlePluginPortal()
}
}
build.gradle:
plugins {
id 'groovy'
id 'com.gradle.plugin-publish' version '0.10.1'
id 'java-gradle-plugin'
id 'maven-publish'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation gradleApi()
implementation 'org.codehaus.groovy:groovy-all:2.5.12'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
gradlePlugin {
automatedPublishing = false
plugins {
simplePlugin {
id = 'com.company.publish-plugin'
implementationClass = 'com.company.publisher.PublishPlugin'
}
}
}
println project.name
project.description = 'Plugin to deploy on artifactory'
project.group = 'com.company'
project.version = '1.0.0'
project.ext.artifactoryUrl = "https://internalRepo.jfrog.io/xxxx"
static boolean isSnapshot(project) {
project.version.contains('SNAPSHOT')
}
publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId 'publish-plugin'
version project.version
}
}
repositories {
maven {
url project.artifactoryUrl
credentials {
username project.artifactoryUser
password project.artifactoryPassword
}
}
}
}
I get the following :
Plugin Repositories (could not resolve plugin artifact ‘com.company.publish-plugin:com.company.publish-plugin.gradle.plugin:1.0.0’)
Searched in the following repositories:
xxxx
It’s weird as the publish doesn’t produce anything with gradle.plugin on the artifact name.
Any ideas ?
These guys are doing the same : https://github.com/gluonhq/client-gradle-plugin/blob/master/build.gradle
And they get the gradle.plugin
https://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/client-gradle-plugin/