@@ -65,7 +65,7 @@ public void loadLibraryLocal(File file) {
65
65
* @param repo 仓库地址
66
66
* @param savePath 保存路径
67
67
*/
68
- public void loadLibraryMaven (String groupId , String artifactId , String version , String repo , Path savePath ) throws Exception {
68
+ public void loadLibraryMaven (String groupId , String artifactId , String version , String repo , Path savePath ) throws ParserConfigurationException , IOException , SAXException {
69
69
loadLibraryMaven (groupId , artifactId , version , repo , ".jar" , savePath );
70
70
}
71
71
@@ -79,7 +79,7 @@ public void loadLibraryMaven(String groupId, String artifactId, String version,
79
79
* @param archiveSuffix 文件后缀(通常为.jar)
80
80
* @param savePath 保存路径
81
81
*/
82
- public void loadLibraryMaven (String groupId , String artifactId , String version , String repo , String archiveSuffix , Path savePath ) throws Exception {
82
+ public void loadLibraryMaven (String groupId , String artifactId , String version , String repo , String archiveSuffix , Path savePath ) throws ParserConfigurationException , IOException , SAXException {
83
83
String filename = artifactId + "-" + version + archiveSuffix ; // 文件名
84
84
String sha1Filename = filename + ".sha1" ; // sha1文件名
85
85
File file = savePath .resolve (filename ).toFile ();
@@ -158,7 +158,7 @@ private static Document fetchMavenMetadata(String groupId, String artifactId, St
158
158
}
159
159
}
160
160
161
- private static String getJarUrl (String groupId , String artifactId , String version , String repo , String archiveSuffix ) throws Exception {
161
+ private static String getJarUrl (String groupId , String artifactId , String version , String repo , String archiveSuffix ) throws ParserConfigurationException , IOException , SAXException {
162
162
if (version .endsWith ("-SNAPSHOT" )){
163
163
String base = repo + (repo .endsWith ("/" ) ? "" : "/" ) + groupId .replace ("." , "/" ) + "/" + artifactId + "/" + version + "/" ;
164
164
return getSnapshotJarUrl (base , artifactId , version , archiveSuffix );
@@ -168,7 +168,7 @@ private static String getJarUrl(String groupId, String artifactId, String versio
168
168
}
169
169
}
170
170
171
- private static String getSnapshotJarUrl (String baseUrl , String packageName , String packageVersion , String archiveSuffix ) throws Exception {
171
+ private static String getSnapshotJarUrl (String baseUrl , String packageName , String packageVersion , String archiveSuffix ) throws ParserConfigurationException , IOException , SAXException {
172
172
String content = Utils .Http .get (baseUrl + "maven-metadata.xml" );
173
173
DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance ();
174
174
factory .setFeature (XMLConstants .FEATURE_SECURE_PROCESSING , true );
0 commit comments