0
0

More than 1 year has passed since last update.

Gradle - archive contains more than 65535 entries.

Posted at

Problem

* What went wrong:
Execution failed for task ':JarHazardSyncWorker'.
> archive contains more than 65535 entries.
  
  To build this archive, please enable the zip64 extension.
  See: https://docs.gradle.org/7.6/dsl/org.gradle.api.tasks.bundling.Zip.html#org.gradle.api.tasks.bundling.Zip:zip64

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
...
...
...
...skip
Caused by: org.gradle.api.tasks.bundling.internal.Zip64RequiredException: archive contains more than 65535 entries.

To build this archive, please enable the zip64 extension.

Solution

build.gradle

task JarTestExample(type: Jar) {
    zip64 = true // <-- Add this
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
    archivesBaseName = 'TestExample'
    includeEmptyDirs = false

    manifest {
        attributes 'Main-Class': 'com.johnny.TestExample'
    }

	// remove the security files (from mail.jar / activation.jar) so that the jar will be executable.
    from (configurations.implementation.collect { it.isDirectory() ? it : zipTree(it) }) {
	    exclude 'META-INF/MANIFEST.MF'
		exclude 'META-INF/*.SF'
		exclude 'META-INF/*.DSA'
		exclude 'META-INF/*.RSA'
	}

    from sourceSets.main.output
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0