0

I've already tried the solutions proposed in: “Invalid signature file” when attempting to run a .jar but I'm still facing issues. My gradle has the following:

task jarWithDependencies(type: Jar) {
manifest {
    attributes 'Implementation-Title': 'Test',
            'Implementation-Version': version
}
zip64 = true
baseName = project.name + '-all'
archiveName = "$baseName.$extension"
from {
    configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
} {
    exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}

with jar
}

The problem is that when I run it I get the following output:

log4j:WARN No appenders could be found for logger (com.test.Tester).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

And the program then exits.

asm
  • 837
  • 1
  • 16
  • 41
  • 1
    You need to configure a log4j.xml or a BasicConfigurator to enable log4j logging in your jar. – Compass Dec 04 '18 at 20:56
  • Why would this issue pop up by having the exclude statement in build.gradle? – asm Dec 04 '18 at 20:58
  • Are you including the log4j properties/xml file in your gradle jar? If not, it may have been excluded at some point. – Compass Dec 04 '18 at 21:02
  • Got it. I never included it so I was confused as to why this issue should pop up when the only files I'm excluding have to do with certs. In any case, the question you linked solved that part of the problem. Thanks! – asm Dec 04 '18 at 21:07

0 Answers0