xolstice / protobuf-maven-plugin

Maven Plugin that executes the Protocol Buffers (protoc) compiler
https://www.xolstice.org/protobuf-maven-plugin/
Other
242 stars 79 forks source link

JarFile not closed after use #72

Closed laurentgo closed 4 years ago

laurentgo commented 4 years ago

Before submitting a bug report

Describe the bug

AbstractProtocMojo#makeProtoPathFromJar opens jars in classpath to unpack proto descriptors but actually never closes it once done, causing some file descriptor leak. This can be confirmed by using file-leak-detector agent.

Environment

$ mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"

Standalone or IDE standalone

Expected behavior

Files should be closed after proto descriptors have been extracted