gradle-maven-settings-plugin icon indicating copy to clipboard operation
gradle-maven-settings-plugin copied to clipboard

Plugin misinterprets env-references in settings.xml as encrypted values

Open jabbrwcky opened this issue 4 years ago • 0 comments

Hi,

I recently ran into the issue that the plugin tried to decrypt env references in ~/.m2/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">
    <localRepository/>
    <interactiveMode/>
    <offline/>
    <pluginGroups/>
    <servers>
        <server>
            <id>oss</id>
            <username>${env.NEXUS_USERNAME}</username>
            <password>${env.NEXUS_PASSWORD}</password>
        </server>
    </servers>
    <mirrors/>
    <proxies/>
    <profiles>
        <profile>
            <id>oss</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
            </properties>
        </profile>
    </profiles>
    <activeProfiles/>
</settings>

causes the build to fail with Unable to decrypt local Maven settings credentials..

Removing the ${...} brackets resolves the build issues.

This might look similar to #15, but the cause is different as far as I can see.

jabbrwcky avatar Oct 28 '20 15:10 jabbrwcky