1
1
/*
2
- * Copyright 2012-2019 the original author or authors.
2
+ * Copyright 2007-present the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
6
6
* You may obtain a copy of the License at
7
7
*
8
- * https ://www.apache.org/licenses/LICENSE-2.0
8
+ * http ://www.apache.org/licenses/LICENSE-2.0
9
9
*
10
10
* Unless required by applicable law or agreed to in writing, software
11
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
-
17
16
import java .net .*;
18
17
import java .io .*;
19
18
import java .nio .channels .*;
20
19
import java .util .Properties ;
21
20
22
21
public class MavenWrapperDownloader {
23
22
24
- private static final String WRAPPER_VERSION = "0.5.5 " ;
23
+ private static final String WRAPPER_VERSION = "0.5.6 " ;
25
24
/**
26
25
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
27
26
*/
28
27
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
29
- + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar" ;
28
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar" ;
30
29
31
30
/**
32
31
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
@@ -55,7 +54,7 @@ public static void main(String args[]) {
55
54
// wrapperUrl parameter.
56
55
File mavenWrapperPropertyFile = new File (baseDirectory , MAVEN_WRAPPER_PROPERTIES_PATH );
57
56
String url = DEFAULT_DOWNLOAD_URL ;
58
- if (mavenWrapperPropertyFile .exists ()) {
57
+ if (mavenWrapperPropertyFile .exists ()) {
59
58
FileInputStream mavenWrapperPropertyFileInputStream = null ;
60
59
try {
61
60
mavenWrapperPropertyFileInputStream = new FileInputStream (mavenWrapperPropertyFile );
@@ -66,7 +65,7 @@ public static void main(String args[]) {
66
65
System .out .println ("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'" );
67
66
} finally {
68
67
try {
69
- if (mavenWrapperPropertyFileInputStream != null ) {
68
+ if (mavenWrapperPropertyFileInputStream != null ) {
70
69
mavenWrapperPropertyFileInputStream .close ();
71
70
}
72
71
} catch (IOException e ) {
@@ -77,8 +76,8 @@ public static void main(String args[]) {
77
76
System .out .println ("- Downloading from: " + url );
78
77
79
78
File outputFile = new File (baseDirectory .getAbsolutePath (), MAVEN_WRAPPER_JAR_PATH );
80
- if (!outputFile .getParentFile ().exists ()) {
81
- if (!outputFile .getParentFile ().mkdirs ()) {
79
+ if (!outputFile .getParentFile ().exists ()) {
80
+ if (!outputFile .getParentFile ().mkdirs ()) {
82
81
System .out .println (
83
82
"- ERROR creating output directory '" + outputFile .getParentFile ().getAbsolutePath () + "'" );
84
83
}
0 commit comments