Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adds a settings.xml file to your Spring Boot maven wrapper
#!/usr/bin/env bash
# Secure workaround for https://issues.sonatype.org/browse/MVNCENTRAL-1369
# Navigate to the root of your Spring Boot project where a Maven wrapper is present and run this script
cd .mvn/wrapper
wget https://gist.githubusercontent.com/kbastani/d4b4c92969ec5a22681bb3daa4a80343/raw/f166086ef051369383b02dfb74317cd07b6f2c6e/settings.xml
cd ../../
./mvnw clean install -s .mvn/wrapper/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>securecentral</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<!--Override the repository (and pluginRepository) "central" from the
Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
@snandaganv

This comment has been minimized.

Copy link

@snandaganv snandaganv commented Aug 9, 2018

Thanks you for providing settings.xml Spring Boot maven wrapper

@simonmiller99

This comment has been minimized.

Copy link

@simonmiller99 simonmiller99 commented Oct 23, 2018

thank you - that is a "poorly-documented elsewhere" lifesaver

@konradish

This comment has been minimized.

Copy link

@konradish konradish commented Jan 17, 2020

I wish that -s would take a URI directly!

@shashiks

This comment has been minimized.

Copy link

@shashiks shashiks commented Jul 8, 2020

This is fantastic thnx!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment