JavaPackager icon indicating copy to clipboard operation
JavaPackager copied to clipboard

* What went wrong: Execution failed for task ':packageFaceMorph'. > Cannot invoke "io.github.fvarrui.javapackager.gradle.PackagePluginExtension.getDuplicatesStrategy()" because "extension" is null

Open manuelddahmen opened this issue 3 months ago • 0 comments

JavaPackager version

1.7.6

Operating system

Windows

OS version

11 Family

Build tool

Gradle

JDK version

Oracle OpenJdk 21

Short description

Exception when trying to build executables in build.gradle.

Steps to reproduce

compile a sample project with this in build.gradle:


tasks.withType(io.github.fvarrui.javapackager.gradle.PackagePluginExtension).configureEach {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
    extension = "jar"
}

tasks.register('packageFaceMorph', io.github.fvarrui.javapackager.gradle.PackageTask) {
    dependsOn build
    // mandatory
    mainClass = 'one.empty3.apps.facedetect.JFrameEditPolygonsMappings'
    manifest {
        mainClass = "one.empty3.apps.facedetect.JFrameEditPolygonsMappings"
    }
    // optional
    bundleJre = true
    generateInstaller = true
    administratorRequired = true
    platform = "auto"// | "linux" | "mac" | "windows"
    additionalResources = [file('res'), file('resources'),]
    linuxConfig {
    }
    macConfig {
    }
    winConfig {
    }
}

Expected behavior

Compiles ok

Actual behavior

Build failed with exception.

Logs and output

.\gradlew -x test packageFaceMorph
> Task :packageFaceMorph FAILED

[Incubating] Problems report is available at: file:///D:/Current/empty3-desktop-ux/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':packageFaceMorph'.
> Cannot invoke "io.github.fvarrui.javapackager.gradle.PackagePluginExtension.getDuplicatesStrategy()" because "extension" is null

Checklist

  • [x] I searched for existing related issues
  • [x] I can provide a minimal reproducible example if needed

manuelddahmen avatar Oct 31 '25 13:10 manuelddahmen