Reputation: 623
I have a maven project that uses the buildnumber-maven-plugin
and I have changed my git remote as I moved the project from GitLab to GitHub, but now when I try to run mvn clean install
I get the error
ssh: Could not resolve hostname github.com:lukebrewerton: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
But I can clone the GH repo using my command line and push/pull etc, it just seems to be the maven command that doesn't work.
My 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">
<modelVersion>4.0.0</modelVersion>
<groupId>net.socialgamer</groupId>
<artifactId>pyx</artifactId>
<version>0.7.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>pyx</name>
<scm>
<url>https://github.com/lukebrewerton/cahds</url>
<connection>scm:git:ssh://[email protected]:lukebrewerton/cahds.git</connection>
<developerConnection>scm:git:ssh://[email protected]:lukebrewerton/cahds.git</developerConnection>
</scm>
....
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>true</doUpdate>
<revisionOnScmFailure>0</revisionOnScmFailure>
<shortRevisionLength>7</shortRevisionLength>
</configuration>
</plugin>
Upvotes: 0
Views: 731
Reputation: 18405
We have two issues here:
scm:git:ssh://server_name[:port]/path_to_repository
(https://maven.apache.org/scm/git.html). As far as I can see, the clone button in GitHub provides an invalid URL for both Maven and Git itself. Otherwise you should file this with SCM and I will take a look at it.
Upvotes: 1