git - How do i successfully use the Maven release plug-in with GitHub (or GitHub enterprise) when using a CI tool like Hudson/Jenkins -


how use maven release plug-in github (or github enterprise) when using ci tool hudson/jenkins

problems encountered are

  • maven not commit if pom.xml in sub folder rather top level. due subsequent builds fail tag name exists.
  • in spite of setting public key authentication between source server runs ci job, git push fails 1 of following errors
    • public key authentication failed
    • unknown service git

there multiple things need correct work.

  1. for sub-folder commit of pom.xml work, bug resolved in maven release plug-in 2.5.1. latest dependencies. below section shows pom.xml

    <plugin>     <groupid>org.apache.maven.plugins</groupid>     <artifactid>maven-release-plugin</artifactid>     <version>2.5.1</version>      <dependencies>         <dependency>             <groupid>org.apache.maven.scm</groupid>             <artifactid>maven-scm-provider-gitexe</artifactid>             <version>1.9.2</version>         </dependency>     </dependencies>      <configuration>         <checkmodificationexcludes>             <checkmodificationexclude>pom.xml</checkmodificationexclude>         </checkmodificationexcludes>     </configuration> </plugin> 
  2. correctly configure scm section in pom.xml. public key authentication work, use ssh protocol. https protocol, user/password needed, answer not cover that. should possible providing user/pwd in maven settings.xml in servers section.

    <scm>     <developerconnection>scm:git:ssh://github.com/org/repo.git</developerconnection>     <url>https://github.com/org/repo</url>     <tag>head</tag> </scm> 
  3. create user called git in source server. if run other user, developerconnection url need have git@github.com in stead of github.com. maven try put git:****** in git push command , fails service unknown. if use other user ssh github, reject public key authentication failed.

  4. using git user, generate ssh keys , configure following simple steps below

    https://help.github.com/articles/generating-ssh-keys/

  5. edit hudson/jenkins job below

    • under source code management section, provide url of git repo. might need put git protocol ci installs not support https.
    • mention branch in branches build (e.g. development)
    • click advanced , put same branch name in section "checkout/merge local branch (optional)"

run job maven goals clean compile release:prepare , release:perform. should work.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -