No, not in general; there's no magic that will turn something that's not a file on disk into a java.io.File
. Many Maven plugins (e.g., maven-checkstyle-plugin
's configLocation
are designed to allow more flexible input for just these cases:
This parameter is resolved as resource, URL, then file. If successfully resolved, the contents of the configuration is copied into the ${project.build.directory}/checkstyle-configuration.xml file before being passed to Checkstyle as a configuration.
As a workaround, if the plugin cannot be changed, dependency:unpack
may be a way to get a classpath resource into a local file (see Maven: extract files from jar).