code: public URL findResource(String resource) throws MojoFailureException {
          // first search relatively to the base directory
          URL res = toURL(new File(basedir, resource));
          if (res != null) {
              return res;
          }
  
          // if not found, search for absolute location on file system, or relative to execution dir
          res = toURL(new File(resource));
          if (res != null) {
              return res;
          }
  
          // if not found, try the classpaths
          String cpResource = resource.startsWith("/") ? resource.substring(1) : resource;
  
          // tries compile claspath of projet
          res = compileClassPath.getResource(cpResource);
          if (res != null) {
              return res;
          }
  
          // tries this plugin classpath
          res = pluginClassPath.getResource(cpResource);
          if (res != null) {
              return res;
          }
  
          // otherwise, tries to return a valid URL
          try {
              res = new URL(resource);
              res.openStream().close();
              return res;
          }
          catch (Exception e) {
              throw new MojoFailureException("Resource " + resource + " not found in file system, classpath or URL: " + e.getMessage(), e);
          }
      }
docs: Find a resource by searching:<br/>
  1. In the filesystem, relative to basedir<br/>
  2. In the filesystem, as an absolute path (or relative to current execution directory)<br/>
  3. In project classpath<br/>
  4. In plugin classpath<br/>
  5. As a URL
  
  @param resource The resource to get
  @return A valid URL
  @throws MojoFailureException If the resource is not found