When configuring Maven repositories in the Nexus UI, use the following JSON configurations. Ensure that the repository names used in the group configuration match the names assigned to the hosted and proxy repositories.
### Maven Hosted Repository (e.g., `maven2-hosted`)
```json
{
"maven" : {
"versionPolicy" : "SNAPSHOT",
"checksumPolicy" : "WARN",
"strictContentTypeValidation" : false
},
"storage" : {
"writePolicy" : "ALLOW"
}
}
Maven Proxy Repository (e.g., maven2-proxy)
{
"maven" : {
"versionPolicy" : "MIXED",
"checksumPolicy" : "WARN",
"strictContentTypeValidation" : false
},
"proxy" : {
"remoteUrl" : "https://repo1.maven.org/maven2/",
"contentMaxAge" : 3600
},
"httpclient" : {
"connection" : {
"timeout" : 1500,
"retries" : 3
},
"authentication" : {
"type" : "username",
"username" : "admin",
"password" : "admin123"
}
},
"storage" : {
"writePolicy" : "ALLOW"
}
}
Maven Group Repository (e.g., maven2-group)
Note: Group repositories aggregate content from members and do not use versionPolicy, layoutPolicy, or contentDisposition fields.
{
"group" : {
"memberNames" : ["maven2-hosted", "maven2-proxy"]
},
"storage" : {
"writePolicy" : "ALLOW"
}
}