部署失败:未在分配管理元素中的POM中指定存储库元素

时间:2016-08-01 23:12:43

标签: java rest maven tomcat intellij-idea

我正在使用maven在intelliJ中尝试这个例子(https://www.mkyong.com/webservices/jax-rs/jersey-hello-world-example/)。我能够安装项目,但部署会出现此错误。

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-cli) on project RESTfulExample: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

有谁知道我在这里失踪了什么?我是否需要添加其他任何内容才能进行部署?

以下是我的POM文件

<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.konrad.common</groupId>
<artifactId>RESTfulExample</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>RESTfulExample Maven Webapp</name>
<url>http://maven.apache.org</url>

<repositories>
    <repository>
        <id>maven2-repository.java.net</id>
        <name>Java.net Repository for Maven</name>
        <url>http://download.java.net/maven/2/</url>
        <layout>default</layout>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-server</artifactId>
        <version>1.8</version>
    </dependency>

    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.0</version>
    </dependency>

</dependencies>

<build>
    <finalName>RESTfulExample</finalName>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<distributionManagement>
    <repository>
        <id>localSnap</id>
        <name>RepositoryProxyRel</name>
        <url>http://127.0.0.1:8080/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
        <id>MylocalSnap</id>
        <name>RepositoryProxySnap</name>
        <url>http://127.0.0.1:8080/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
</distributionManagement>

0 个答案:

没有答案