Skip to content

Allow custom tasks other than run to work with Pulumi Java #1788

@Toshimichi0915

Description

@Toshimichi0915

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

When using Pulumi with Java, the only supported way to deploy infrastructures is through the run task. This creates a limitation for users who want to use run task for debugging their applications on their local machines.

Currently, attempting to invoke Pulumi from any task other than run is simply not supported — The Pulumi Java plugin is hardcoded to expect the task name to be run, and this behavior is not configurable.

Introduce a configuration option — ideally in Pulumi.yaml — to define which Gradle task should be treated as the Pulumi entry point. This would allow users to explicitly specify the task to use, enabling better integration with custom Gradle builds and CI/CD pipelines.

tasks.register('deploy', JavaExec) {
    dependsOn 'build'

    classpath = sourceSets.main.runtimeClasspath
    mainClass = 'PulumiMain'
}

Affected area/feature

Currently it is unknown.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions