Skip to content

Commit 518025a

Browse files
committed
release-version.sh: fix insecure schema location
Maven doesn't support HTTP schema locations anymore. And Eclipse yields errors on the project line, too.
1 parent e6e0891 commit 518025a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

release-version.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,20 @@ test "$FETCH_HEAD" = HEAD ||
203203
test "$FETCH_HEAD" = "$(git merge-base $FETCH_HEAD $HEAD)" ||
204204
die "'$defaultBranch' is not up-to-date"
205205

206+
# Ensure that schema location URL uses HTTPS, not HTTP.
207+
if grep -q http://maven.apache.org/xsd/maven-4.0.0.xsd pom.xml >/dev/null 2>/dev/null
208+
then
209+
echo "====================================================================="
210+
echo "NOTE: Your POM's schema location uses HTTP, not HTTPS. Fixing it now."
211+
echo "====================================================================="
212+
sed 's;http://maven.apache.org/xsd/maven-4.0.0.xsd;https://maven.apache.org/xsd/maven-4.0.0.xsd;' pom.xml > pom.new &&
213+
mv -f pom.new pom.xml &&
214+
git commit pom.xml \
215+
-m 'POM: use HTTPS for schema location URL' \
216+
-m 'Maven no longer supports plain HTTP for the schema location.' \
217+
-m 'And using HTTP now generates errors in Eclipse (and probably other IDEs).'
218+
fi
219+
206220
# Ensure license headers are up-to-date.
207221
test "$SKIP_LICENSE_UPDATE" -o -z "$licenseName" -o "$licenseName" = "N/A" || {
208222
mvn license:update-project-license license:update-file-header &&

0 commit comments

Comments
 (0)