Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可否不要自动拉源码 #5

Open
nicklasyao opened this issue Aug 3, 2020 · 3 comments
Open

可否不要自动拉源码 #5

nicklasyao opened this issue Aug 3, 2020 · 3 comments

Comments

@nicklasyao
Copy link

源码我已经自己拉取到 --git-work-dir,可否不要再拉源码?如何解决
Caused by: org.eclipse.jgit.errors.TransportException: http://[email protected]:8080/xx/xx-system.git: Authentication is required but no CredentialsProvider has been registered

@nicklasyao
Copy link
Author

用户名密码,是从哪读取的 GitAdapter.java
/**
* git授权。需要设置拥有所有权限的用户
* @param username git用户名
* @param password git用户密码
*/
public static void setCredentialsProvider(String username, String password) {
if(usernamePasswordCredentialsProvider == null || !usernamePasswordCredentialsProvider.isInteractive()){
usernamePasswordCredentialsProvider = new UsernamePasswordCredentialsProvider(username,password);
}
}

@nicklasyao
Copy link
Author

package org.jacoco.startup.ReportGenerator 中修改,设置用户名、密码

private static IBundleCoverage analyzeStructure(String title, ExecFileLoader execFileLoader,
        String gitPath,
        String branch,
        String compareBranch,
        String tag,
        String compareTag,
        File[] classDirs) throws IOException {
    //git 授权登录
    **GitAdapter.setCredentialsProvider("xxxxx", "xxx-2020");**

    CoverageBuilder coverageBuilder = null;

@chendapeng1984
Copy link

用你的方法解决了!!!加上这一句 GitAdapter.setCredentialsProvider("xxxxx", "xxx-2020");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants