tomasbjerre/git-changelog-gradle-plugin

NoSuchMethodError when using github integration

cpw opened this issue · 3 comments

cpw commented

Hi,
I am trying to use the "gitHubApi" to fetch issue names, and am experiencing a "NoSuchMethodError" when trying to read from github.

This is a ForgeGradle project so it's possible there's a collision with the GSON version or something?

build.gradle snippet:

task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
    filePath = "CHANGELOG.md"
    untaggedName = "Current release ${project.version}"
    gitHubApi = "https://api.github.com/repos/cpw/inventorysorter"
    templateContent = """
# Inventory sorter changelog history
## Version ${project.version} for minecraft ${project.minecraft.version}

{{#tags}}
## {{name}}
-----------

{{issues}}
### {{name}}
{{#commits}}
* {{{message}}}
{{/commits}}
{{/tags}}
    """
}

Full build.gradle is here: https://github.com/cpw/inventorysorter/blob/master/build.gradle (I may or may not have pushed the new changelog code, hence copied above).

Stacktrace: https://gist.github.com/cpw/bafa5b31d04161e3863b34d554c09b20

If I comment out the gitHubApi line, it works fine. Accessing the URL works fine from browser and command line (not a busy project by any stretch of the imagination).

I would suggest using 2.6.2 here:
https://github.com/MinecraftForge/ForgeGradle/blob/master/build.gradle#L75
And try that. As you say, its a dependency collision with Gson.

cpw commented

Hi, I seem to have encountered this issue with recent versions of the plugin. It seems that 1.48 works, but 1.49 fails because of the GSON NoSuchMethodError. It looks like it tries to talk to github whether or not you have a githubApi URL configured in 1.49 and up.

Try 1.53, it will not use the integrations and will not hit this problem. Unless you are using title/issue/lable in the template.