-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Publish Gradle plugin to plugins.gradle.org #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there any work happening in this space? This plugin is the only reason for us to use the dreaded
block on my current project. We'd really like to be able to use the plugin DSL for this gem as well. |
Are there any plans for adding plugin to Plugin Portal? |
Had a similar issue here is how I solved it. Voting this up! |
@Enigamitsuj solution works, but is another workaround. Any plans to work on this? |
I've published v1.1.3 to plugins.gradle.org. There's a problem somewhere but I've been unable to track it down yet. When I use legacy plugin application then I can use the plugin successfully. When I use the newer plugin DSL then I see this error:
Clearly there is something not quite right with the metadata, or there is some conflict with what is published to plugins.gradle.org and what is published to Maven Central. Unfortunately Gradle doesn't give much useful info (this is the exception). Should be easy to fix I'm sure. I will leave the plugin published for now (for diagnostic purposes), but will take it down within 7 days if I don't resolve the problem. |
|
Sorry, I misread and you switched over. |
plugins {
id 'java'
id "org.jsonschema2pojo" version "1.1.3"
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
}
test {
useJUnitPlatform()
} as well as buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:1.1.3"
}
}
plugins {
id 'java'
}
apply plugin: "org.jsonschema2pojo"
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
}
test {
useJUnitPlatform()
} Worked for me 🤔 (gradle |
I was able to reproduce the problem. The issue is the ordering of buildscript repositories. If Maven Central is the first on the list then the plugin id does not resolve. If the Gralde Plugin Portal is the first then it does. The released artifact metadata differs between the repositories (central id |
Ah yes, so the jar on Central contains this: and the jar on portal contains this: Looks like we just need the org.jsonschema2pojo.properties present in the Central jar. Should be trivial to fix. Thanks for investigating @ben-manes ! |
This should be done for discoverability to promote js2p and has no functionality changes. It is required if using the new plugin DSL, but that's not used in practice yet.
The steps appear minimal. It does require changing to the new Gradle plugin naming convention, so there is a little upgrade pain.
JCenter is a two-way mirror of Maven Central. Ideally this requires a small change to the build while still publishing as usual. If the new attributes can only be provided if publishing to JCenter directly, then this won't be worth the effort.
The text was updated successfully, but these errors were encountered: