code: public static MavenRemoteRepository createRemoteRepository(final String id, final String url, final String layout)
              throws IllegalArgumentException {
          try {
              return createRemoteRepository(id, new URL(url), layout);
          }
          catch (MalformedURLException e) {
              throw new IllegalArgumentException("invalid URL", e);
          }
      }
docs: Overload of {@link #createRemoteRepository(String, URL, String)} that thrown an exception if URL is wrong.
  
  @param id The unique ID of the repository to create (arbitrary name)
  @param url The base URL of the Maven repository
  @param layout he repository layout. Should always be "default"
  @return A new <code>MavenRemoteRepository</code> with the given ID and URL.
  @throws IllegalArgumentException for null or empty id or if the URL is technically wrong or null