- static URL mavenRepoUrl(String repoBase, M2Artifact artifact) {
- String url = artifactUrl(repoBase == null ? MAVEN_CENTRAL_BASE_URL : repoBase, artifact);
- try {
- return new URL(url);
- } catch (MalformedURLException e) {
- // it should not happen
- throw new IllegalStateException(e);
- }
+ static URI mavenRepoUrl(String repoBase, M2Artifact artifact) throws URISyntaxException {
+ String uri = artifactUrl(repoBase == null ? MAVEN_CENTRAL_BASE_URL : repoBase, artifact);
+ return new URI(uri);