# How do I remove product-descriptor tag from plugin.xml when running the IDE?

**URL:** <https://platform.jetbrains.com/t/how-do-i-remove-product-descriptor-tag-from-plugin-xml-when-running-the-ide/1303>\
**Category:** IntelliJ Platform\
**Created:** [April 10, 2025, 7:18pm UTC](https://platform.jetbrains.com/t/how-do-i-remove-product-descriptor-tag-from-plugin-xml-when-running-the-ide/1303 "2025-04-10T19:18:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrasferenczi](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/andrasferenczi/32/460_2.png) [@andrasferenczi](https://platform.jetbrains.com/u/andrasferenczi)\
**Post date:** [April 10, 2025, 7:18pm UTC](https://platform.jetbrains.com/t/how-do-i-remove-product-descriptor-tag-from-plugin-xml-when-running-the-ide/1303/1 "2025-04-10T19:18:45Z")

</div>

I can’t figure this out and I don’t get why I haven’t seen any kind of mentions about this in the docs.

So what I would like to do:

- I would like to release a paid plugin
- for this, I have to have `<product-descriptor />` in the `plugin.xml`
- but when I am just playing around and execute it with the `runIde`, I would like to just run it, without seeing the “Manage Licenses” dialog

The best would be to have some kind of `runIdeWithoutLicenseCheck`, but I have no idea how to create it properly. It takes so much work and hacking I am assuming I am doing something against Jetbrains’ idea on what runIde is or how I am supposed to use it.

I just don’t want to uncomment and undo the tag in the `plugin.xml` each time I use `runIde` and when I commit to git.

What I’ve tried so far is to create an action that changes the `plugin.xml`, but that seems to have no effect on the final output, even though the file itself is changed:

```kotlin
val myPluginXmlPatch by tasks.registering {
    dependsOn("patchPluginXml")

    doLast {
        val file = tasks.named<org.jetbrains.intellij.platform.gradle.tasks.PatchPluginXmlTask>("patchPluginXml")
            .get()
            .outputFile
            .asFile
            .get()

        val patchedXml = file.readText()
            .replace(
                Regex("""(?s)\s*<product-descriptor\b[^>]*?/>"""),
                "",
            )
        file.writeText(patchedXml)

        logger.lifecycle("Patched plugin.xml | ${file.absolutePath}")
    }
}

tasks.named("processResources") {
    dependsOn(myPluginXmlPatch)
}

```

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![jonathanlermitage.1](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jonathanlermitage.1](https://platform.jetbrains.com/u/jonathanlermitage.1)\
**Post date:** [April 10, 2025, 11:29pm UTC](https://platform.jetbrains.com/t/how-do-i-remove-product-descriptor-tag-from-plugin-xml-when-running-the-ide/1303/2 "2025-04-10T23:29:17Z")

</div>

Instead, you can remove the product descriptor from your `plugin.xml`, then add it programmatically via your `build.gradle.kts`:

```auto
intellijPlatform {
  pluginConfiguration {
    if (paidPlugin) {
      productDescriptor {
        // this will create and populate the product-descriptor tag in plugin.xml (in the generated plugin archive)
        code = "..."
        releaseDate = "..."
        releaseVersion = "..."
        optional = false // or true for freemium plugin
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![andrasferenczi](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/andrasferenczi/32/460_2.png) [@andrasferenczi](https://platform.jetbrains.com/u/andrasferenczi)\
**Post date:** [April 11, 2025, 4:42pm UTC](https://platform.jetbrains.com/t/how-do-i-remove-product-descriptor-tag-from-plugin-xml-when-running-the-ide/1303/3 "2025-04-11T16:42:46Z")

</div>

Thanks! This was a step forward in the right direction, but `paidPlugin` was still kinda tricky to specify.

* * *

For anyone struggling with this in the future, this is how I solved it:

In `build.gradle.kts`:

```kotlin
val licenseRequired: Boolean
    get() = !project.hasProperty("noLicense")

```

This ensures that whenever the `runIde` is executed with `-PnoLicense` flag (flag should be in the `run command` and NOT `Environment Variables`, since it is used at build time), the build script will have access to it.

This way I can conditionally add `productDescriptor` (just as Jonathan said):

```kotlin
intellijPlatform {
    pluginConfiguration {
        version = providers.gradleProperty("pluginVersion")

        if (licenseRequired) {
            productDescriptor {
                code = "CODE"
                releaseDate = "20250411"
                releaseVersion = "20250"
                optional = false
            }
        }
    }
}

```

Then I added `generateBuildConfig` as well, because I also need checks in my codebase.

```kotlin
kotlin {
    sourceSets.main {
        kotlin.srcDir("build/generated/sources/example")
    }
}

val generateBuildConfig by tasks.registering {
    // The file should be regenerated when this value changes, task should not be cached
    val licenseRequired = licenseRequired
    inputs.property("licenseRequired", licenseRequired)

    val outputDir = layout.buildDirectory.dir("generated/sources/example").get().asFile
    val packageName = "com.example"

    val content = """
        |package $packageName
        |
        |object BuildConfig {
        | const val LICENSE_REQUIRED: Boolean = $licenseRequired
        |}
    """.trimMargin()

    outputs.dir(outputDir)

    doLast {
        val file = File(outputDir, "com/example/BuildConfig.kt")
        file.parentFile.mkdirs()
        file.writeText(content)
        logger.lifecycle("Generated BuildConfig.kt with LICENSE_REQUIRED = $licenseRequired")
    }
}

tasks.named("compileKotlin") {
    dependsOn(generateBuildConfig)
}

```
