GoogleCloudPlatform / artifact-registry-maven-tools

Apache License 2.0
22 stars 23 forks source link

Fix to apply plugin to project buildscript #51

Closed loosebazooka closed 2 years ago

loosebazooka commented 3 years ago

This only is applied if the plugin is applied at the settings level

Signed-off-by: Appu Goundan appu@google.com

fixes #40 I think

jonjohnsonjr commented 3 years ago

/gcbrun

chanseokoh commented 2 years ago

This only is applied if the plugin is applied at the settings level

Does this mean the user has to apply the plugin in settings.gradle and only in the legacy way using apply() (and probably should remove the plugin from plugins { id "com.google.cloud.artifactregistry.gradle-plugin" } in build.gradle too)? The doc should be updated too?

loosebazooka commented 2 years ago

I'm not sure that you can to apply a plugin from mavenLocal() in a settings.xml using the plugins block, at least I haven't successfully managed it. But for a published plugin from the gradle, I think it might be fine?

chanseokoh commented 2 years ago

Sorry, what I meant is not about applying a snapshot version for testing.

What I was asking is that, assuming this is fixed and the artifact plugin published a new release with the fix, when a user wants to use artifactregistry://... in the buildscript block (as in the original issue #40), does the user have to apply the published plugin in settings.xml (because plugins{} cannot come before buildscript {}), or is it still possible to declare it in the usual way with the plugins block in build.gradle?

loosebazooka commented 2 years ago

Right, I'm not completely sure about a plugin that is available on the gradle plugin portal, but I think you can use the plugins block.

loosebazooka commented 2 years ago

Ah so it has to be applied in the settings.gradle to make modifications to a projects buildscript

loosebazooka commented 2 years ago

User verified it's working: https://github.com/GoogleCloudPlatform/artifact-registry-maven-tools/issues/40#issuecomment-889146338

trietsch commented 2 years ago

@loosebazooka @Gridasov any idea when a release will be available on https://plugins.gradle.org ?

yihanzhen commented 2 years ago

@loosebazooka v2.1.2 is here: https://plugins.gradle.org/plugin/com.google.cloud.artifactregistry.gradle-plugin. Please let us know if that solves your problem!

edit: sorry, I meant to @trietsch

trietsch commented 2 years ago

Awesome, thanks for notifying @yihanzhen! I'll give it a spin :)

trietsch commented 2 years ago

@yihanzhen @loosebazooka thanks for the work and the release, it's working. This'll clean up our Gradle build scripts :D