# Precompiled Script Plugin unable to reference classes provided by 3rd party plugins

**URL:** <https://discuss.gradle.org/t/precompiled-script-plugin-unable-to-reference-classes-provided-by-3rd-party-plugins/42242>\
**Category:** Help/Discuss\
**Created:** [February 17, 2022, 10:31pm UTC](https://discuss.gradle.org/t/precompiled-script-plugin-unable-to-reference-classes-provided-by-3rd-party-plugins/42242 "2022-02-17T22:31:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![briceburg](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/briceburg/32/9673_2.png) [@briceburg](https://discuss.gradle.org/u/briceburg)\
**Post date:** [February 17, 2022, 10:31pm UTC](https://discuss.gradle.org/t/precompiled-script-plugin-unable-to-reference-classes-provided-by-3rd-party-plugins/42242/1 "2022-02-17T22:31:27Z")

</div>

I have a conventions plugin (a precompiled script plugin) which;

- includes the openapi generator gradle plugin
- registers a custom task using the `org.openapitools.generator.gradle.plugin.tasks.GenerateTask` that the openapi generator plugin provides.

It looks something like:

```gradle
plugins {
  id 'org.openapi.generator'
}

...
task openApiGenerateClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
    generatorName = "java" // https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/java.md
    inputSpec = "$projectDir/openapi.json"
    outputDir = "$buildDir/generated/client"
    invokerPackage = "${rootProject.group}.openapi.client"
    apiPackage = invokerPackage
    modelPackage = invokerPackage
    configOptions = [
            "dateLibrary": "java8",
            "library": "resttemplate",
    ]
}

```

however I get an error saying ‘org’ is an unknown property when I attempt to build;

```gradle
> groovy.lang.MissingPropertyException: Could not get unknown property 'org' for project ':openapi' of type org.gradle.api.Project.

```

Any ideas?

I am able to provide a custom task from my project’s build.gradle (outside of the precompiled script plugin – but I really need to register the custom task inside the conventions plugin).

My precompiled script’s build.gradle looks something like:

```gradle
plugins {
  id 'maven-publish'
}
group = 'com.foo.conventions'

repositories {
  gradlePluginPortal()
}

dependencies {
  implementation 'org.openapi.generator:org.openapi.generator.gradle.plugin:5.3.0' // https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin
  ...
}

```

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [February 20, 2022, 1:06am UTC](https://discuss.gradle.org/t/precompiled-script-plugin-unable-to-reference-classes-provided-by-3rd-party-plugins/42242/2 "2022-02-20T01:06:44Z")

</div>

Can you priovide an [MCVE](https://stackoverflow.com/help/mcve)?  
Like you showed it, it will not even build but fail with complaining about `implementation` in the build script.  
An if I add the proper plugin, it works just fine.
