Укажите указанный c URL-адрес хранилища в настройках maven. xml для развертывания в Nexus - PullRequest
0 голосов
/ 26 марта 2020

Я новый парень на Maven и Nexus. У меня проблема с развертыванием моего проекта Maven (разработанного с IntelliJ) на моем местном Nexus. Вы найдете прикрепленные мои настройки maven. xml

Моя цель - развернуть мой проект без изменения файла pom. xml, только параметры ~ / .m2 /. xml

Я попробовал следующую команду (которая работает): $ mvn clean deploy -DaltDeploymentRepository = nexus :: default :: http://192.168.1.8: 8081 / repository / maven-snapshots

Но Я хочу получить те же результаты только с: $ mvn clean deploy

Есть идеи?

Спасибо

<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>
            <!--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>******</password>
        </server>
    </servers>

</settings>

1 Ответ

0 голосов
/ 26 марта 2020

Вы можете добавить <properties> раздел к вашему settings.xml и добавить

<altDeploymentRepository>nexus::default::http://192.168.1.8:8081/repository/maven-snapshots</altDeploymentRepository>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...