本文介绍了Maven SCM插件:找不到Git SSH提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将Maven SCM插件与Git一起使用时遇到问题.我无法使该插件完全正常工作,因为它说未找到提供程序.当我运行mvn scm:tag时,它会给我以下错误:

I'm having a problem using the Maven SCM plugin with Git. I cannot get the plugin to work at all because it says the provider is not found. It gives me the following error when I run mvn scm:tag:

我的pom.xml如下所示:

My pom.xml looks like the following:

<project>
  <modelVersion>4.0.0</modelVersion>

  <groupId>net.REDACTED</groupId>
  <artifactId>hello-world-service-minimal</artifactId>
  <version>1.0.13</version>
  <packaging>pom</packaging>

  <name>hello-world-service</name>

  <properties>
     <lang.java.source>1.7</lang.java.source>
     <lang.java.target>1.7</lang.java.target>

    <dep.junit>4.11</dep.junit>
  </properties>

  <scm>
     <developerConnection>scm:git:ssh://git@git-eng.REDACTED.com|PROJECT_NAME/hello-world-service-minimal.git</developerConnection>
     <url>scm:git:http://git-eng.REDACTED.com/PROJECT_NAME/hello-world-service-minimal/tree/master</url>
  </scm>

  <distributionManagement>
     <repository>
        <id>dev.release</id>
        <url>file:${project.build.directory}/repository/</url>
     </repository>
  </distributionManagement>

  <build>
      <plugins>
          <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>versions-maven-plugin</artifactId>
              <version>2.1</version>
          </plugin>
          <plugin>
              <artifactId>maven-scm-plugin</artifactId>
              <version>1.9</version>
              <configuration>
                  <tag>${project.artifactId}-${project.version}</tag>
              </configuration>
          </plugin>
      </plugins>
  </build>
</project>

任何人都知道如何解决此问题吗?这真让我抓狂.我根本无法弄清楚我在做什么错.

Anyone have any idea how to fix this? This is driving me crazy. I can't figure out what I am doing wrong at all.

推荐答案

<url>标记用于常规可浏览URL.您需要一个<connection>标记(<connection>用于读取访问,<developerConnection>用于写入访问):

The <url> tag is for a regular browsable URL. You need a <connection> tag (<connection> is for read access, <developerConnection> is for write access):

<scm>
  <connection>scm:git:ssh://git@git-eng.REDACTED.com|PROJECT_NAME/hello-world-service-minimal.git</connection>
  <developerConnection>scm:git:ssh://git@git-eng.REDACTED.com|PROJECT_NAME/hello-world-service-minimal.git</developerConnection>
  <url>http://git-eng.REDACTED.com/PROJECT_NAME/hello-world-service-minimal/tree/master</url>
</scm>

有关更多信息,请参见 Maven POM参考.

See the Maven POM Reference for more information.

这篇关于Maven SCM插件:找不到Git SSH提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 19:10
查看更多