0

I want to make an executable jar in Gradle:

task fatJar(type: Jar) {
    manifest {
           attributes (     
                'Main-Class': 'com.mycompany.json_validator.Main'
            )
    }
    baseName 'json-validator'
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}

But i have an error from Gradle "Could not expand ZIP ..... archive is not a ZIP archive". I have this error on dependency, which is not .jar, it is pom.

compile group: 'org.glassfish.jersey', name: 'jersey-bom', version: '2.17', ext: 'pom'

How can i make an executable jar with it?

spartaneg
  • 329
  • 2
  • 12

1 Answers1

1

This appears to be the same issue described here: Gradle trying to unzip a pom typed dependency

The answer there describes what is happening and a possible remedy.

Alternatively, it should execute if you remove , ext: 'pom' from your dependency though I don't know if this is what you are going for.

mibogo
  • 173
  • 1
  • 8