Maven忽略了scm标签

时间:2014-10-09 23:19:15

标签: java git maven version-control

我正在尝试执行mvn release:prepare命令,但我收到消息 scm连接或必须指定developerconnection

我在<scm>

中有pom.xml部分
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

   <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    ...

    <scm>
        <connection>scm:git:https://github.com/repository-name</connection>
        <developerConnection>scm:git:https://github.com/repository-name</developerConnection>
        <url>https://github.com/repository-name</url>
    </scm>
</project>

Maven版本是3.2.3。怎么了?

1 个答案:

答案 0 :(得分:1)

OP Anton Golovincomments {},.git项末尾添加<scm>就足够了:

<scm>
    <connection>scm:git:https://github.com/repository-name.git</connection>
    <developerConnection>scm:git:https://github.com/repository-name.git</developerConnection>
    <url>https://github.com/repository-name.git</url>
</scm>