Maven: элемент репозитория не был указан в POM внутри distributionManagement?

Я пытаюсь запустить команду mvn release: выполнить , но получаю такую ​​ошибку:

 Не удалось выполнить цель
org.apache.maven.plugins: maven-deploy-plugin: 2.5: развернуть
(default-deploy) в проекте git-demo:
Ошибка развертывания: элемент репозитория
не было указано в POM внутри
элемент distributionManagement или в
-DaltDeploymentRepository = id :: layout :: url
параметр

Вот мой файл pom.xml :

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sonatype.blog</groupId>
    <artifactId>git-demo</artifactId>
    <packaging>jar</packaging>
    <version>1.1-SNAPSHOT</version>
    <name>git-demo</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <scm>
        <connection>scm:git:git@github.com:Christian-Achilli-KP/git-demo.git</connection>
        <url>scm:git:git@github.com:Christian-Achilli-KP/git-demo.git</url>
        <developerConnection>scm:git:git@github.com:Christian-Achilli-KP/git-demo.git</developerConnection>
    </scm>

    <distributionManagement>
        <!-- use the following if you're not using a snapshot version. -->
        <repository>
            <id>localSnap</id>
            <name>RepositoryProxyRel</name>
            <url>http://127.0.0.1:8080/nexus/content/repositories/releases/</url>
        </repository>
        <!-- use the following if you ARE using a snapshot version. -->
        <snapshotRepository>
            <id>MylocalSnap</id>
            <name>RepositoryProxySnap</name>
            <url>http://127.0.0.1:8080/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.1</version>
            </plugin>
        </plugins>
    </build>
</project>

На самом деле я вижу объявление

репозитория

внутри тега

distributionManagent

.

Вот мой ] settings.xml :

<settings>
    <servers>
        <server>
            <id>localSnap</id>
            <username>deployment</username>
            <password>****</password>
        </server>

        <server>
            <id>MylocalSnap</id>
            <username>deployment</username>
            <password>****</password>
        </server>

        <server>
            <id>myserver</id>
            <username>tomcat</username>
            <password>tomcat</password>
        </server>
    </servers>
    <mirrors>
        <mirror>
            <!--This sends everything else to /public -->
            <id>nexus</id>
            <mirrorOf>*</mirrorOf>
            <url>http://127.0.0.1:8080/nexus/content/groups/public/</url>
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>nexus</id>
            <properties>
                <project.build.sourceEncoding>MacRoman</project.build.sourceEncoding>
                <project.reporting.outputEncoding>MacRoman</project.reporting.outputEncoding>
            </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>
        <activeProfile>nexus</activeProfile>
    </activeProfiles>

</settings>

Есть какой-нибудь совет, почему он жалуется?

74
задан Neuron 27 April 2018 в 00:36
поделиться