To avoid reimplementing this here, we could use info.aduna.io.MavenUtil which is distributed with Sesame so we already have it as a dependency.

https://bitbucket.org/openrdf/sesame/src/dd9c1f2efe208b78a81179270fe7561285deafb7/core/util/src/main/java/info/aduna/io/MavenUtil.java?at=2.7.x