pf4j: Can't find plugin.properties file inside .jar
I got a plugin .jar that looks like:
META-INF
main/Main.class
plugin.properties
.classpath
pf4j finds the .jar inside my plugins folder just fine, then tries to run the descriptor finders. First one is the properties descriptor finder, which is the one I want, but when it’s time to fetch the descriptor, it fails in this line:
https://github.com/pf4j/pf4j/blob/master/pf4j/src/main/java/org/pf4j/util/FileUtils.java#L231
With a file system not found exception. The passed URI looks like this:
jar:file:/res/plugins/testPlugin.jar
Which is correct, relative to the project’s execution path.
Since that one fails, it runs the manifest finder, which also fails since I’m trying to use plugin.properties instead.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (13 by maintainers)
Commits related to this issue
- Prevent FileSystemAlreadyExistsException (#229) — committed to pf4j/pf4j by decebals 6 years ago
Thanks it’s worked now able to load the properties Thankyou decebals
For anyone else that isn’t using Maven like me, snapshots:
https://oss.sonatype.org/content/repositories/snapshots/org/pf4j/pf4j/
Seems to be working now, I can load the plugin, call some stuff on an extension, unload the plugin, load it again, and call stuff on the extension again just fine. I think this issue can be closed.
Thanks! 😄
I will add in few minutes the fix proposed by you, because it’s useful.
I will take a look. Maybe we can create a test unit for regression.