smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

smallrye-graphql-gradle-plugin not published on Gradle Plugin Portal

Open marceloverdijk opened this issue 4 years ago • 22 comments

Hi @phillip-kruger

It seems the smallrye-graphql-gradle-plugin jar is not published on maven central. Do you know if the exec-maven-plugin inside the pom was executed? Maybe something else is needed as well... it's a bit complicated as to create a Gradle plugin jar you have to use Gradle ;-)

See: https://repo1.maven.org/maven2/io/smallrye/smallrye-graphql-gradle-plugin/1.0.3/ (it only contains the pom, not the jar)

Looking further we might also think about publishing the plugin to the Gradle Plugin Portal.

marceloverdijk avatar Jun 03 '20 21:06 marceloverdijk

PS: I had locally a smallrye-graphql-gradle-plugin 1.0.2 in my m2 repo and that one works as expected. Also in combination with the Quarkus GraphQL integration part of Quarkus 1.5.0 👍

marceloverdijk avatar Jun 03 '20 21:06 marceloverdijk

Hmm. Perhaps it is because the gradle plugin project declares its packaging to be pom and it should be jar? https://github.com/smallrye/smallrye-graphql/blob/1.0.3/tools/gradle-plugin/pom.xml#L15

jmartisk avatar Jun 04 '20 05:06 jmartisk

https://github.com/smallrye/smallrye-graphql/blob/1.0.3/tools/gradle-plugin/pom.xml#L122 This could also be part of the problem?

jmartisk avatar Jun 04 '20 05:06 jmartisk

Yes that could be.

When setting it up I already some doubts this would work the first time ;-). The pom setup is based on Quarkus as they also have Maven build with a Gradle plugin project. Note they also skip deploying the project but a bit different: https://github.com/quarkusio/quarkus/blob/master/devtools/gradle/pom.xml#L124-L133

Maybe we could ask @gsmet or @gastaldi from the Quarkus team for advise?

marceloverdijk avatar Jun 04 '20 06:06 marceloverdijk

@marceloverdijk right, that depends if you're using the nexus-staging-plugin in the release. The trick in Quarkus is that we run gradle publishPlugin after the release is performed (to deploy to the Gradle Plugin portal), so it makes little sense to deploy it to maven central.

On a side note, I have a feeling that the build-helper-maven-plugin is useless here too (I'll look into removing it from the quarkus gradle plugin's pom.xml)

gastaldi avatar Jun 04 '20 10:06 gastaldi

thx @gastaldi , maybe smallrye-graphql can take the same approach @jmartisk @phillip-kruger? That way we would also have the plugin to the Gradle Plugin Portal.

marceloverdijk avatar Jun 04 '20 10:06 marceloverdijk

Sounds good to me. Our CI build and release is in .github folder as we are using GitHub actions. So maybe see if you can fix it there ?

phillip-kruger avatar Jun 04 '20 10:06 phillip-kruger

@phillip-kruger I've created PR #279 but it is only a part of getting the plugin published.

I've not used Github actions before so I feel a bit uncomfortable. Also an account needs to be created on the Gradle Plugin Portal and a key/secret to be created which probably can be owned by someone from the SmallRye team .

marceloverdijk avatar Jun 04 '20 13:06 marceloverdijk

@phillip-kruger thx for merging the PR. what do you think about creating the Gradle Plugin Portal account?

marceloverdijk avatar Jun 04 '20 21:06 marceloverdijk

Hi @marceloverdijk. Yes let me check with @kenfinnigan and/or @radcortez .

phillip-kruger avatar Jun 05 '20 07:06 phillip-kruger

@marceloverdijk The gradle key and secret is now available in GH Secret:

GRADLE_PUBLISH_KEY GRADLE_PUBLISH_SECRET

That should do it right ?

phillip-kruger avatar Jun 08 '20 10:06 phillip-kruger

I think we need to do:

  • Updating gradle.properties automatically after the release:prepare goal as @jmartisk mentioned: https://github.com/smallrye/smallrye-graphql/pull/279#issuecomment-638847917
  • And the running gradle publishPlugins -Pgradle.publish.key=<key> -Pgradle.publish.secret=<secret> as build step

and then hope it works :-D

marceloverdijk avatar Jun 08 '20 10:06 marceloverdijk

Hi @marceloverdijk - are you planning to make the changes above ?

phillip-kruger avatar Jul 10 '20 10:07 phillip-kruger

Hi @phillip-kruger I’m leaving on holiday tomorrow so it will be at least after my holidays...

marceloverdijk avatar Jul 10 '20 10:07 marceloverdijk

Cool ! Enjoy your time off :)

phillip-kruger avatar Jul 10 '20 11:07 phillip-kruger

Is this plugin published? I tried following the instructions in the README and the plugin wasn't found, ultimately trying to resolve my problem led to this still-open issue. I don't see any release logic in the github actions, so it's hard to tell if the release logic got built somewhere else.

zandaleph avatar Oct 14 '21 08:10 zandaleph

@zandaleph no it's not being published. If you know how you are welcome to contribute :)

phillip-kruger avatar Oct 14 '21 08:10 phillip-kruger

Thanks for the quick response! I don't know much about Gradle plug-ins just yet, hence my confusion. But I might take a crack at it if I get a chance. Does the Maven plug-in work as expected here?

zandaleph avatar Oct 14 '21 14:10 zandaleph

As far as I know. @jmartisk ?

phillip-kruger avatar Oct 14 '21 14:10 phillip-kruger

The Maven plugin generally should work, except of course the serious problem https://github.com/smallrye/smallrye-graphql/issues/1102 that I've just found :) but it works in the sense that it's in public Maven repos and can be used

jmartisk avatar Oct 15 '21 06:10 jmartisk

I'm trying to use this plugin and not being successful importing it. (gradle kts)

plugins {
    java
    id("io.quarkus")
    id("io.smallrye.graphql").version("1.0.2-SNAPSHOT")
}

error message:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/rui/Projects/metadata-viewer/build.gradle.kts' line: 1

* What went wrong:
Plugin [id: 'io.smallrye.graphql', version: '1.0.2-SNAPSHOT'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'io.smallrye.graphql:io.smallrye.graphql.gradle.plugin:1.0.2-SNAPSHOT')
  Searched in the following repositories:
    MavenLocal(file:/Users/rui/.m2/repository/)
    MavenRepo
    Gradle Central Plugin Repository

bitkill avatar Apr 09 '22 15:04 bitkill

@jmartisk opened a PR to fix this, there is still some work needed to to this in the GH Actions, but this should be a good start. PR: https://github.com/smallrye/smallrye-graphql/pull/1351

bitkill avatar Apr 09 '22 17:04 bitkill

This has been resolved for some time (see https://plugins.gradle.org/plugin/io.smallrye.graphql), so I'll close it

jmartisk avatar Feb 06 '23 11:02 jmartisk