sonatype / ossindex-public

Sonatype OSS Index - Public
Apache License 2.0
6 stars 9 forks source link

Make username and password read from settings.xml #2

Closed dadoonet closed 6 years ago

dadoonet commented 6 years ago

AFAIK if I want to use my own user/password to connect to the service, I have to set something like:

<plugin>
    <groupId>org.sonatype.ossindex.maven</groupId>
    <artifactId>ossindex-maven-plugin</artifactId>
    <version>1.0.0</version>
    <executions>
        <execution>
            <id>audit-dependencies</id>
            <phase>verify</phase>
            <goals>
                <goal>audit</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <clientConfiguration>
            <authConfiguration>
                <username>foo</username>
                <password>bar</password>
            </authConfiguration>
        </clientConfiguration>
    </configuration>
</plugin>

It could be nice if we can define this username/password in an external file like ~/.m2/settings.xml as a ossindex server:

<settings>
    <servers>
        <server>
            <id>ossindex</id>
            <username>foo</username>
            <password>bar</password>
        </server>
    </servers>
</settings>
jdillon commented 6 years ago

This looks like an issue that should be on ossindex-maven, but you are right the Maven plugin and Enforcer rule should support pulling this authentication details from settings.xml

jdillon commented 6 years ago

I've create a PR (see above) in ossindex-maven that adds authId parameter to maven-plugin and enforcer-rule.