Skip to content

Commit ed736af

Browse files
committed
[mvn] Update maven wrapper
1 parent 9f33995 commit ed736af

File tree

6 files changed

+211
-178
lines changed

6 files changed

+211
-178
lines changed

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Tomcat-Slf4j-Logback (https://github.com/tomcat-slf4j-logback/tomcat9-slf4j-logback/)
55
6-
Copyright (c) 2010-2023 Tomcat-Slf4j-Logback.
6+
Copyright (c) 2010-2024 Tomcat-Slf4j-Logback.
77
88
All rights reserved. This program and the accompanying materials are made available under the
99
terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available

.mvn/settings.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Tomcat-Slf4j-Logback (https://github.com/tomcat-slf4j-logback/tomcat9-slf4j-logback/)
55
6-
Copyright (c) 2010-2023 Tomcat-Slf4j-Logback.
6+
Copyright (c) 2010-2024 Tomcat-Slf4j-Logback.
77
88
All rights reserved. This program and the accompanying materials are made available under the
99
terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available
@@ -14,12 +14,15 @@
1414
-->
1515
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1616
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
17+
1718
<servers>
19+
<!-- Used for sonatype snapshots and releases -->
1820
<server>
1921
<id>ossrh</id>
2022
<username>${env.CI_DEPLOY_USERNAME}</username>
2123
<password>${env.CI_DEPLOY_PASSWORD}</password>
2224
</server>
25+
2326
<!-- Used for gh-pages-scm publish via maven-scm-publish-plugin -->
2427
<server>
2528
<id>gh-pages-scm</id>
@@ -28,10 +31,19 @@
2831
<scmVersion>gh-pages</scmVersion>
2932
</configuration>
3033
</server>
34+
35+
<!-- Github deployments (site) -->
3136
<server>
3237
<id>github</id>
3338
<username>${env.CI_DEPLOY_USERNAME}</username>
3439
<password>${env.GITHUB_TOKEN}</password>
3540
</server>
41+
42+
<!-- NVD API Access (dependency-check-plugin) -->
43+
<server>
44+
<id>nvd</id>
45+
<password>${env.NVD_API_KEY}</password>
46+
</server>
3647
</servers>
48+
3749
</settings>

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21,77 +21,72 @@
2121
import java.io.InputStream;
2222
import java.net.Authenticator;
2323
import java.net.PasswordAuthentication;
24+
import java.net.URI;
2425
import java.net.URL;
2526
import java.nio.file.Files;
2627
import java.nio.file.Path;
2728
import java.nio.file.Paths;
2829
import java.nio.file.StandardCopyOption;
30+
import java.util.concurrent.ThreadLocalRandom;
2931

30-
public final class MavenWrapperDownloader
31-
{
32-
private static final String WRAPPER_VERSION = "3.2.0";
32+
public final class MavenWrapperDownloader {
33+
private static final String WRAPPER_VERSION = "3.3.1";
3334

34-
private static final boolean VERBOSE = Boolean.parseBoolean( System.getenv( "MVNW_VERBOSE" ) );
35+
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE"));
3536

36-
public static void main( String[] args )
37-
{
38-
log( "Apache Maven Wrapper Downloader " + WRAPPER_VERSION );
37+
public static void main(String[] args) {
38+
log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION);
3939

40-
if ( args.length != 2 )
41-
{
42-
System.err.println( " - ERROR wrapperUrl or wrapperJarPath parameter missing" );
43-
System.exit( 1 );
40+
if (args.length != 2) {
41+
System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing");
42+
System.exit(1);
4443
}
4544

46-
try
47-
{
48-
log( " - Downloader started" );
49-
final URL wrapperUrl = new URL( args[0] );
50-
final String jarPath = args[1].replace( "..", "" ); // Sanitize path
51-
final Path wrapperJarPath = Paths.get( jarPath ).toAbsolutePath().normalize();
52-
downloadFileFromURL( wrapperUrl, wrapperJarPath );
53-
log( "Done" );
54-
}
55-
catch ( IOException e )
56-
{
57-
System.err.println( "- Error downloading: " + e.getMessage() );
58-
if ( VERBOSE )
59-
{
45+
try {
46+
log(" - Downloader started");
47+
final URL wrapperUrl = URI.create(args[0]).toURL();
48+
final String jarPath = args[1].replace("..", ""); // Sanitize path
49+
final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize();
50+
downloadFileFromURL(wrapperUrl, wrapperJarPath);
51+
log("Done");
52+
} catch (IOException e) {
53+
System.err.println("- Error downloading: " + e.getMessage());
54+
if (VERBOSE) {
6055
e.printStackTrace();
6156
}
62-
System.exit( 1 );
57+
System.exit(1);
6358
}
6459
}
6560

66-
private static void downloadFileFromURL( URL wrapperUrl, Path wrapperJarPath )
67-
throws IOException
68-
{
69-
log( " - Downloading to: " + wrapperJarPath );
70-
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
71-
{
72-
final String username = System.getenv( "MVNW_USERNAME" );
73-
final char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
74-
Authenticator.setDefault( new Authenticator()
75-
{
61+
private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath)
62+
throws IOException {
63+
log(" - Downloading to: " + wrapperJarPath);
64+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
65+
final String username = System.getenv("MVNW_USERNAME");
66+
final char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
67+
Authenticator.setDefault(new Authenticator() {
7668
@Override
77-
protected PasswordAuthentication getPasswordAuthentication()
78-
{
79-
return new PasswordAuthentication( username, password );
69+
protected PasswordAuthentication getPasswordAuthentication() {
70+
return new PasswordAuthentication(username, password);
8071
}
81-
} );
72+
});
8273
}
83-
try ( InputStream inStream = wrapperUrl.openStream() )
84-
{
85-
Files.copy( inStream, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING );
74+
Path temp = wrapperJarPath
75+
.getParent()
76+
.resolve(wrapperJarPath.getFileName() + "."
77+
+ Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp");
78+
try (InputStream inStream = wrapperUrl.openStream()) {
79+
Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING);
80+
Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING);
81+
} finally {
82+
Files.deleteIfExists(temp);
8683
}
87-
log( " - Downloader complete" );
84+
log(" - Downloader complete");
8885
}
8986

90-
private static void log( String msg )
91-
{
92-
if ( VERBOSE )
93-
{
94-
System.out.println( msg );
87+
private static void log(String msg) {
88+
if (VERBOSE) {
89+
System.out.println(msg);
9590
}
9691
}
9792

.mvn/wrapper/maven-wrapper.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
wrapperVersion=3.3.1
1718
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
19+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.1/maven-wrapper-3.3.1.jar

0 commit comments

Comments
 (0)