n0mer / gradle-git-properties

Gradle plugin for `git.properties` file generation
https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties
Apache License 2.0
323 stars 55 forks source link

Shadow jar #184

Closed kkocel closed 3 years ago

kkocel commented 3 years ago

This will shadow plugin dependencies, preventing them from clashing with other plugins that depend on grgit / jgit.

This hurts this library since people are forced to choose one lib instead of using two - see: https://github.com/allegro/axion-release-plugin/issues/357#issuecomment-755392221

tha2015 commented 3 years ago

Thanks for the PR. I deployed to my local maven repository (using ./gradlew clean publishToMavenLocal, verified the generated pom.xml file, and found the generated pom.xml still contains the dependency. Do you think it is an issue or it will be gone when deploying to remote repository?

kkocel commented 3 years ago

@tha2015 please note that dependency is inruntimescope. So it should not be an issue. Generated jar has dependencies shadowed and bundled:

Screenshot 2021-07-20 at 11 38 56

Anyway, I asked if runtime dependency is required: https://github.com/johnrengelman/shadow/issues/694

tha2015 commented 3 years ago

It is a good thing that this plugin will not be impacted by other plugins because it will use the repackaged dependencies only. But I guess the runtime dependency might still have some impact to other plugins which sharing the same dependency but with an older version?

kkocel commented 3 years ago

I guess that in such cases version resolution will kick in. Many other plugins are shadowing their dependencies in order to avoid such situations. ihmo after this PR situation will be better than before.

kkocel commented 3 years ago

@tha2015 I asked question on SO how to get rid of dependency: https://stackoverflow.com/questions/68470193/exclude-dependency-from-pom-using-maven-publish-plugin

kkocel commented 3 years ago

@tha2015 I added the configuration that disables runtime dependencies from pom and module.json

kkocel commented 3 years ago

@tha2015 I made all the changes requested. Can this PR be merged?

tha2015 commented 3 years ago

@tha2015 I made all the changes requested. Can this PR be merged?

Hi @kkocel , Very sorry for the delay and thanks for your patience. I've been super busy lately but everything is better now. I will release it soon. Thanks, Thai

kkocel commented 2 years ago

@tha2015 @n0mer Kindly ask when you plan to create a new release?

tha2015 commented 2 years ago

Hi Chris, I finally published the version 2.4.0-rc1. Please help to test it if you have some time. Note that I'm seeing an error which is reported recently. I will need to investigate it soon.

plugins { id 'java' id "com.gorylenko.gradle-git-properties" version "2.4.0-rc1" }

group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '1.8'

repositories { mavenCentral() }

Gradle 6.1.1

Regards, Thai

On Tue, Nov 23, 2021 at 6:11 AM Chris Kocel @.***> wrote:

@tha2015 https://github.com/tha2015 @n0mer https://github.com/n0mer Kindly ask when you plan to create a new release?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/n0mer/gradle-git-properties/pull/184#issuecomment-976592230, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTHP6Q5II36IOFZIXXS3M3UNOOKVANCNFSM474YCSTA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tha2015 commented 2 years ago

Hi @kkocel , FYI. Version 2.4.0 has been released with this PR. Thanks for your patience. -Thai

kkocel commented 2 years ago

thanks!