<?xml version='1.0' encoding='UTF-8'?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
          xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <servers>
        <server>
            <id>sonatype-nexus-snapshots</id>
            <username>${SONATYPE_USERNAME}</username>
            <password>${SONATYPE_PASSWORD}</password>
        </server>
        <server>
            <id>sonatype-nexus-staging</id>
            <username>${SONATYPE_USERNAME}</username>
            <password>${SONATYPE_PASSWORD}</password>
        </server>
    </servers>
</settings>
<?xml version='1.0' encoding='UTF-8'?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
          xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <servers>
        <server>
            <id>sonatype-nexus-snapshots</id>
            <username>${env.SONATYPE_USERNAME}</username>
            <password>${env.SONATYPE_PASSWORD}</password>
        </server>
        <server>
            <id>sonatype-nexus-staging</id>
            <username>${env.SONATYPE_USERNAME}</username>
            <password>${env.SONATYPE_PASSWORD}</password>
        </server>
    </servers>
</settings>

Use proper syntax for environment variables.
Use proper syntax for environment variables.