# Generating code with openapi generator plugin

**URL:** <https://discuss.gradle.org/t/generating-code-with-openapi-generator-plugin/49702>\
**Category:** Help/Discuss\
**Created:** [October 22, 2024, 8:57am UTC](https://discuss.gradle.org/t/generating-code-with-openapi-generator-plugin/49702 "2024-10-22T08:57:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanE](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@johanE](https://discuss.gradle.org/u/johanE)\
**Post date:** [October 22, 2024, 8:57am UTC](https://discuss.gradle.org/t/generating-code-with-openapi-generator-plugin/49702/1 "2024-10-22T08:57:47Z")

</div>

I somehow gets the wrong version of jackson for the plugin. I get a `NoSuchMethodException` on a YAMLFactory method. I think get this error because of the build script is updating the jackson dependency.

How do I see what is upgrading the jackson dependency?  
Is there a way to look at the build script classpath?

---

<div class="post-metadata">

**Author:** ![johanE](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@johanE](https://discuss.gradle.org/u/johanE)\
**Post date:** [October 22, 2024, 9:20am UTC](https://discuss.gradle.org/t/generating-code-with-openapi-generator-plugin/49702/2 "2024-10-22T09:20:15Z")

</div>

I can’t figure out how I have missed the `buildEnvironment` task. That answers my question.

---

<div class="post-metadata">

**Author:** ![hmartin](https://avatars.discourse-cdn.com/v4/letter/h/d07c76/32.png) [@hmartin](https://discuss.gradle.org/u/hmartin)\
**Post date:** [October 23, 2024, 8:19pm UTC](https://discuss.gradle.org/t/generating-code-with-openapi-generator-plugin/49702/3 "2024-10-23T20:19:19Z")

</div>

I had a similar issue with Google’s Plugin for the GCP Artifacts repo. I had to explicitly add the version of Jackson that I needed in `settings.gradle`:

```gradle
buildscript {
    repositories {
        mavenCentral()
        gradlePluginPortal()
        mavenLocal()
    }
    dependencies {
        classpath("gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.2")
        // The Google Gradle Plugin pulls in some old jackson dependency which causes the OpenAPI code generator
        // to fail. The solution is to explicitly add the correct version to the class path.
        classpath("com.fasterxml.jackson.core:jackson-core:2.17.2")
    }
}

```

---

<div class="post-metadata">

**Author:** ![johanE](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@johanE](https://discuss.gradle.org/u/johanE)\
**Post date:** [October 24, 2024, 5:57am UTC](https://discuss.gradle.org/t/generating-code-with-openapi-generator-plugin/49702/4 "2024-10-24T05:57:33Z")

</div>

That is the solution. I just applied it to a build.gradle file.

It turned out that I didn’t need the dependencies that pulled in the old versions any more.
