maven-dependency-plugin could not be resolved

31 views Asked by At

I am trying to build my project using maven but keep on getting following error.

[ERROR] Plugin org.apache.maven.plugins:maven-dependency-plugin:3.1.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:3.1.1: The following artifacts could not be resolved: org.apache.maven.plugins:maven-dependency-plugin:pom:3.1.1 (absent): Could not transfer artifact org.apache.maven.plugins:maven-dependency-plugin:pom:3.1.1 from/to nexus-thirdparty (https://nexus.audatex.com/nexus/content/repositories/thirdparty): status code: 401, reason phrase: Unauthorized (401) -> [Help 1]

I have tried deleting .m2/repository and again did mvn clean install but still the same error is coming.

Any advice is helpful. Thanks.

1

There are 1 answers

0
Dumcore On

In case this happens also with other artifacts you try to fetch from this Nexus, please check your maven settings .m2/settings.xml if there are all necessary credentials for your nexus server present. Alternatively they could be set in the pom.xml, but that would be a security issue.

In case there are present it could also possibly be that you just don't have the right permissions onto the repository "thirdparty" of your nexus server. I would recommend to validate this with your administrator.

To give you a sample of what you should be looking for:

<servers>
    <server>
        <id>internal-company-repository</id>
        <username>demo-user</username>
        <password>dummy-password</password>
        <privateKey>${user.home}/.ssh/bael_key</privateKey>
        <passphrase>dummy-passphrase</passphrase>
        <filePermissions>664</filePermissions>
        <directoryPermissions>775</directoryPermissions>
        <configuration></configuration>
    </server>
</servers>

Note that the id here needs to match the id of the <repository> attribute in your pom.xml