ImFlog/schema-registry-plugin

unable to build project when plugin is set

nikoncode opened this issue · 2 comments

When I enable schema registry plugin it breaks build of my project with exception:

A problem occurred configuring root project 'demo'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.github.imflog:kafka-schema-registry-gradle-plugin:1.4.0.
     Required by:
         project : > com.github.imflog.kafka-schema-registry-gradle-plugin:com.github.imflog.kafka-schema-registry-gradle-plugin.gradle.plugin:1.4.0
      > Could not resolve com.github.imflog:kafka-schema-registry-gradle-plugin:1.4.0.
         > Could not parse POM https://plugins.gradle.org/m2/com/github/imflog/kafka-schema-registry-gradle-plugin/1.4.0/kafka-schema-registry-gradle-plugin-1.4.0.pom
            > Could not find io.confluent:kafka-schema-registry-parent:6.2.0.
              Searched in the following locations:
                - https://plugins.gradle.org/m2/io/confluent/kafka-schema-registry-parent/6.2.0/kafka-schema-registry-parent-6.2.0.pom
              If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.

Plugins section:

plugins {
	id 'org.springframework.boot' version '2.3.12.RELEASE'
	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
	id "com.github.imflog.kafka-schema-registry-gradle-plugin" version "1.4.0"
	id 'com.google.protobuf' version '0.8.16'
	id 'java'
	id 'idea'
}

Repository settings:

repositories {
	mavenCentral()
	maven {
		url "https://packages.confluent.io/maven/"
	}
}

Most likely it happens because I am trying to resolve plugin using plugin keyword from gradle repository.

Gradle version: 6.9
Plugin versions checked: 1.4.0 & 1.3.0

Hello @nikoncode,
Are the repositories that you mention in the buildscript block ?
Something like:

buildscript {
    repositories {
        gradlePluginPortal()
        maven {
            url = uri("https://packages.confluent.io/maven/")
        }
        maven {
            url = uri("https://jitpack.io")
        }
    }
}

plugins {
    id("com.github.imflog.kafka-schema-registry-gradle-plugin") version "1.4.0"
}

It seems that the README is not clear enough, I've pushed clarification in d2e1c4f.
Tell me if it helps :)

Yeah, that works. Thanks.