[ERROR] Failed to execute goal :maven-release-plugin:2.5. The git-push command failed

Am trying to release a new version of the formFileter module to 1.3 following an update of the module to run on platform 2.* .

. i have the mavenrepo credentials , and am now doing the mvn release:prepare… but am getting this error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project formfilter: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: HttpRequestException encountered.
[ERROR]    An error occurred while sending the request.
[ERROR] bash: /dev/tty: No such device or address
[ERROR] error: failed to execute prompt script (exit code 1)
[ERROR] fatal: could not read Username for 'https://github.com': No error
[ERROR]
[ERROR] -> [Help 1]

Am i supposed to also have credentilas to the openmrs github repo?? and how am i supposed to configure it in my POM ?? @dkayiwa @wyclif @darius @k.joseph

Did you first of all, try googling the error message?

1 Like

yes sir .

  • one solution is to adjust the tag in the root POM to have th openmrs git repo credentials like

     <scm>    <connection>scm:git:http://${GIT_USERNAME}:${GIT_PASSWORD}@server.host.name/path/to/project.git</connection>
      <url>http://server.host.name/path/to/project.git</url>
      <tag>HEAD</tag>
     </scm>
    

or

  • To disable maven from perfoming any git push or pull like here

    <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-release-plugin</artifactId>
         <version>2.5.3</version>
         <configuration>
             <localCheckout>true</localCheckout>
             <pushChanges>false</pushChanges>
         </configuration>
     </plugin>

@tendomart is advising me to instead Release through Bamboo CI. It will do an automatic release to Maven and Bintray

@mozzy did you say the PR was merged ?

yes sir @tendomart

How was it merged with errors ?

nooo :sunglasses: . ovcos it wasnt merged with errors. the errors are arising because of the command “mvn release: prepare”, like trying to release it , not necesarily because am trying to compile “mvn package” . it compiles pretty fine , it has no problem there

@mozzy consider

1 Like

and those are the possible solutions i got

I have just made a commit to the module: https://github.com/openmrs/openmrs-module-formfilter/commit/82bdb0bd1e2eb8d8513b7972667063afa6196c00

Can you try again?

1 Like

now am getting this error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.380 s
[INFO] Finished at: 2018-07-31T11:14:06-06:00
[INFO] Final Memory: 13M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project formfilter: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-tag command failed.
[ERROR] Command output:
[ERROR] fatal: tag '1.3' already exists

:thinking: i dont know whos bewitching me

Because you have the tag locally from a previous release attempt that failed, you will need to run mvn release:rollback to undo things before you attempt the release again.

1 Like

ya i have rolled back. but wen i attempted another release , i still get the error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project formfilter: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: HttpRequestException encountered.
[ERROR]    An error occurred while sending the request.
[ERROR] bash: /dev/tty: No such device or address
[ERROR] error: failed to execute prompt script (exit code 1)
[ERROR] fatal: could not read Username for 'https://github.com': No error
[ERROR]
[ERROR] -> [Help 1]

To be able to push code to the master OpenMRS repository you need to have a github user account with commit privileges, if you don’t have commit privileges, you will need to create a help desk ticket requesting for them. Once you’ve been assigned the privileges, you will need to configure git on your machine by updating your maven settings.xml file to setup the repository and and login credentials.

1 Like

thank you sir @wyclif. let me surely do that :sunglasses:

Is there any reason why this release is not done by bamboo?

Good point @cintiadr! @mozzy you could configure the module and release it from bamboo following this guide

1 Like

ok thx @wyclif and @cintiadr. let me try bamboo and see

hello @wyclif and @dkayiwa . can u please give an actual exaple of how to set the login credentials in my maven settings file?

here is my settings file. i have already configure in credentials to the maven Repo. and how di i specify the github credentials??

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
  <servers>
    <server>
      <username>${env.BINTRAY_USER}</username>
      <password>${env.BINTRAY_API_KEY}</password>
      <id>bintray-sdk</id>
    </server>
    <server>
      <id>openmrs-repo</id>
      <username>mozzy</username>
      <password>****</password>
    </server>
    <server>
      <id>openmrs-repo-modules</id>
      <username>mozzy</username>
      <password>****</password>
    </server>
    <server>
      <id>openmrs-repo-releases</id>
      <username>mozzy</username>
      <password>****</password>
    </server>
    <server>
      <id>openmrs-repo-snapshots</id>
      <username>mozzy</username>
      <password>*****</password>
    </server>
  </servers>
  <mirrors>
    <mirror>
      <mirrorOf>central</mirrorOf>
      <url>http://mirrors.ibiblio.org/maven2</url>
      <id>ibiblio.org</id>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <properties>
        <archetypeRepository>http://mavenrepo.openmrs.org/nexus/content/repositories/public</archetypeRepository>
        <archetypeCatalog>http://mavenrepo.openmrs.org/nexus/content/repositories/public/archetype-catalog.xml</archetypeCatalog>
      </properties>
      <repositories>
        <repository>
          <id>openmrs-repo</id>
          <name>OpenMRS Nexus Repository</name>
          <url>http://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
        </repository>
        <repository>
          <id>openmrs-repo-thirdparty</id>
          <name>OpenMRS Thirdparty Nexus Repository</name>
          <url>http://mavenrepo.openmrs.org/nexus/content/repositories/thirdparty</url>
        </repository>
        <repository>
          <id>openmrs-bintray-repo</id>
          <name>OpeMRS Maven Bintray Repository</name>
          <url>https://dl.bintray.com/openmrs/maven/</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>openmrs-repo</id>
          <name>OpenMRS Nexus Repository</name>
          <url>http://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
        </pluginRepository>
        <pluginRepository>
          <id>openmrs-bintray-repo</id>
          <name>OpeMRS Maven Bintray Repository</name>
          <url>https://dl.bintray.com/openmrs/maven/</url>
        </pluginRepository>
      </pluginRepositories>
      <id>openmrs</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>openmrs</activeProfile>
  </activeProfiles>
  <pluginGroups>
    <pluginGroup>org.openmrs.maven.plugins</pluginGroup>
    <pluginGroup>org.grails</pluginGroup>
  </pluginGroups>
</settings>

all the servers i configured above are for the maven Repo