Skip to content

Commit b0a1223

Browse files
fix: add maven settings.xml to resolve 403 forbidden errors (#418)
* fix: remove unnecessary coder binary move step in deployment workflow * fix: add maven settings.xml to resolve 403 forbidden errors Adds maven-settings.xml with proper repository configuration and auto-installs it during devcontainer post-create setup. Fixes Maven Central 403 Forbidden errors during dependency downloads. Changes: - Created .devcontainer/maven-settings.xml with mirror config - Updated post-create.sh to auto-install Maven settings - Resolves backend CI build failures --------- Co-authored-by: Mohsin Hashmi <mhashmi@wiser.com>
1 parent 34aaa06 commit b0a1223

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

.devcontainer/maven-settings.xml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0
5+
https://maven.apache.org/xsd/settings-1.2.0.xsd">
6+
7+
<!--
8+
Maven Settings for SimpleAccounts-UAE
9+
This file resolves Maven Central 403 Forbidden errors by configuring proper mirrors and repositories.
10+
-->
11+
12+
<!-- Local repository location -->
13+
<localRepository>${user.home}/.m2/repository</localRepository>
14+
15+
<!-- Maven Central Mirror (using repo1.maven.org) -->
16+
<mirrors>
17+
<mirror>
18+
<id>central-mirror</id>
19+
<name>Maven Central Mirror</name>
20+
<url>https://repo1.maven.org/maven2</url>
21+
<mirrorOf>central</mirrorOf>
22+
</mirror>
23+
</mirrors>
24+
25+
<!-- Default profile with repository configuration -->
26+
<profiles>
27+
<profile>
28+
<id>default</id>
29+
<repositories>
30+
<repository>
31+
<id>central</id>
32+
<name>Maven Central Repository</name>
33+
<url>https://repo.maven.apache.org/maven2</url>
34+
<releases>
35+
<enabled>true</enabled>
36+
<updatePolicy>never</updatePolicy>
37+
</releases>
38+
<snapshots>
39+
<enabled>false</enabled>
40+
</snapshots>
41+
</repository>
42+
</repositories>
43+
<pluginRepositories>
44+
<pluginRepository>
45+
<id>central</id>
46+
<name>Maven Central Plugin Repository</name>
47+
<url>https://repo.maven.apache.org/maven2</url>
48+
<releases>
49+
<enabled>true</enabled>
50+
<updatePolicy>never</updatePolicy>
51+
</releases>
52+
<snapshots>
53+
<enabled>false</enabled>
54+
</snapshots>
55+
</pluginRepository>
56+
</pluginRepositories>
57+
</profile>
58+
</profiles>
59+
60+
<!-- Activate the default profile -->
61+
<activeProfiles>
62+
<activeProfile>default</activeProfile>
63+
</activeProfiles>
64+
65+
</settings>

.devcontainer/post-create.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ ensure_dir "$TARGET_HOME/.m2/wrapper/dists"
5454
# Also ensure npm cache directory is writable
5555
ensure_dir "$TARGET_HOME/.npm"
5656

57+
# Copy Maven settings.xml if it doesn't exist (fixes 403 Forbidden errors)
58+
if [ ! -f "$TARGET_HOME/.m2/settings.xml" ] && [ -f ".devcontainer/maven-settings.xml" ]; then
59+
echo "📝 Installing Maven settings.xml..."
60+
cp .devcontainer/maven-settings.xml "$TARGET_HOME/.m2/settings.xml"
61+
fix_ownership "$TARGET_HOME/.m2/settings.xml"
62+
echo " ✅ Maven settings installed"
63+
fi
64+
5765
# ============================================
5866
# Fix volume permissions (run early to ensure tools work)
5967
# ============================================

0 commit comments

Comments
 (0)