Jenkins git-client: how to move to jgit on windows

前端 未结 2 1971
北恋
北恋 2021-01-06 07:27

Since the Jenkins git-client plugin moved to use jgit, there have been a lot of issues with configuration and all of the solutions I have seen invo

2条回答
  •  被撕碎了的回忆
    2021-01-06 07:41

    Pending a better documentation (more complete than the user guide, and forums), I would rely on:

    org.eclipse.jgit.test/tst/org/eclipse/jgit:

    You will find tons of tests, illustrating how JGit is supposed to be used.

    • Email, for instance, is read from the config file in tst.org.eclipse.jgit.lib.ConfigTest:

      authorName = localConfig.get(UserConfig.KEY).getAuthorName();
      authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
      
    • SSH, as another example, reads its config file as illustrated in tst.org.eclipse.jgit.transport.OpenSshConfigTest

      config("Host orcz\n" + "\tHostName repo.or.cz\n" + "\tPort 2222\n"
        + "\tUser jex\n" + "\tIdentityFile .ssh/id_jex\n"
        + "\tForwardX11 no\n");
      final Host h = osc.lookup("orcz");
      

    And so on...


    You also have the recent (August 2013) JGit cookbook, created by centic (Dominik Stadler)

    Grab it

    git clone git://github.com/centic9/jgit-cookbook
    

    Build it and create Eclipse project files

    mvn dependency:sources eclipse:eclipse package
    

    Run it

    Import the project into an Eclipse workspace and execute the snippets there.

    This cookbook has been updated to JGit 3.0.3.

提交回复
热议问题