|
7 | 7 | import org.w3c.dom.Node;
|
8 | 8 | import org.w3c.dom.NodeList;
|
9 | 9 | import org.xml.sax.InputSource;
|
| 10 | +import org.xml.sax.SAXException; |
10 | 11 |
|
11 | 12 | import javax.annotation.Nullable;
|
12 | 13 | import javax.xml.XMLConstants;
|
13 | 14 | import javax.xml.parsers.DocumentBuilderFactory;
|
| 15 | +import javax.xml.parsers.ParserConfigurationException; |
14 | 16 | import java.io.*;
|
15 | 17 | import java.net.MalformedURLException;
|
16 | 18 | import java.net.URL;
|
@@ -147,14 +149,14 @@ public String getLibraryVersion(String groupId, String artifactId, String repo){
|
147 | 149 | @Nullable
|
148 | 150 | private static Document fetchMavenMetadata(String groupId, String artifactId, String repo) {
|
149 | 151 | try {
|
150 |
| - String content = Utils.Http.get(repo + "/" + groupId.replace(".", "/") + artifactId + "/maven-metadata.xml"); |
| 152 | + String content = Utils.Http.get(repo + "/" + groupId.replace(".", "/") + "/" + artifactId + "/maven-metadata.xml"); |
151 | 153 | DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
152 | 154 | factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
153 | 155 | return factory.newDocumentBuilder().parse(new InputSource(new StringReader(content)));
|
154 |
| - } catch (Exception e) { |
155 |
| - return null; |
156 |
| - } |
157 |
| - } |
| 156 | + } catch (IOException | ParserConfigurationException | SAXException e) { |
| 157 | + throw new RuntimeException(e); |
| 158 | + } |
| 159 | + } |
158 | 160 |
|
159 | 161 | private static String getJarUrl(String groupId, String artifactId, String version, String repo, String archiveSuffix) throws Exception {
|
160 | 162 | if(version.endsWith("-SNAPSHOT")){
|
|
0 commit comments