Ошибка 401 при развертывании maven с учетными данными - PullRequest
0 голосов
/ 27 марта 2020

Я хочу развернуть свой проект в моем локальном нексусе без изменения файла pom. xml.

Я поместил свойства, чтобы просто ввести mvn deploy вместо mvn deploy -DaltDeploymentRepository = ... '

Следующая команда работала, но не с тех пор, как я изменил свойства 'tag: $ mvn clean deploy -DaltDeploymentRepository = nexus :: default :: http://192.168.1.8: 8081 / repository / maven-snapshots

Проблема заключается в том, что у меня ошибка 401, даже если Я поставил свои свидетельства ... Есть идеи, что случилось? Спасибо.

Вот сообщение об ошибке:

Failed to deploy artifacts: Could not transfer artifact cidemo:cidemo-parent:pom:0.0.1-20200327.111507-2 from/to snapshots (http://192.168.1.8:8081/repository/maven-snapshots/): Failed to transfer file: http://192.168.1.8:8081/repository/maven-snapshots/cidemo/cidemo-parent/0.0.1-SNAPSHOT/cidemo-parent-0.0.1-20200327.111507-2.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

Вот мои ~ / .m2 / settings. xml file:

<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <mirror>
            <!--This sends everything else to /public -->
            <id>nexus</id>
            <mirrorOf>*</mirrorOf>
            <url>http://192.168.1.8:8081/repository/maven-public/</url>
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>nexus</id>
            <properties>
                <altDeploymentRepository>nexus::default::http://192.168.1.8:8081/repository/maven-snapshots/</altDeploymentRepository>
                <altSnapshotDeploymentRepository>snapshots::default::http://192.168.1.8:8081/repository/maven-snapshots/</altSnapshotDeploymentRepository>
                <altReleaseDeploymentRepository>releases::default::http://192.168.1.8:8081/repository/maven-releases/</altReleaseDeploymentRepository>
            </properties>
            <!--Enable snapshots for the built in central repo to direct -->
            <!--all requests to nexus via the mirror -->
            <repositories>
                <repository>
                    <id>central</id>
                    <url>http://central</url>
                    <releases><enabled>true</enabled></releases>
                    <snapshots><enabled>true</enabled></snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>central</id>
                    <url>http://central</url>
                    <releases><enabled>true</enabled></releases>
                    <snapshots><enabled>true</enabled></snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>

    </profiles>
    <activeProfiles>
        <!--make the profile active all the time -->
        <activeProfile>nexus</activeProfile>
    </activeProfiles>

    <servers>
        <server>
            <id>nexus</id>
            <username>admin</username>
            <password>{AdV4rKHbmSUH8WGM5LhwCbriByTPxAdtvOP8RZK+kWk=}</password>
        </server>
    </servers>


</settings>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...