jenkins-zh / jenkins-cli

Jenkins CLI allows you to manage your Jenkins in an easy way. Jenkins 命令行客户端
http://www.jenkins-zh.cn/jenkins-cli/
MIT License
388 stars 78 forks source link

when use "jcli cwp", can use mirror to download plugins? #693

Open usernameisnull opened 2 years ago

usernameisnull commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I am in China, so I always encounter network problems and download plugins are too slow or fail. Is it possible to use mirror sources in China, such as Tsinghua or Tencent, when using the "jcli cwp" command. Or this feature needs to be supported by the "cwp" project .

Or specify the mirror source like the "jcli center download -m tencent" command

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

usernameisnull commented 2 years ago

may be I just need to specify maven mirror? I saw the console output,sorry I am just a rookie

LinuxSuRen commented 2 years ago

The command jcli cwp downloads plugins from the center Maven repository, so I think it should be hard to specific a maven mirror.

See also https://github.com/jenkins-zh/jenkins-cli/blob/a8a75cc3daac587456f410232f52ae2fd5fca05f/app/cmd/cwp.go#L142

I'm not sure about this. But you can try to add a mirror to ~/.m2/config

SsLaLal commented 1 year ago

我用jcli cwp指定--mvn-settings-file /usr/local/apache-maven-3.6.3/conf/settings.xml ,但是从jcli的执行日志来看,并没有从我自己settings.xml里配置的mirror去下载依赖

LinuxSuRen commented 1 year ago

我用jcli cwp指定--mvn-settings-file /usr/local/apache-maven-3.6.3/conf/settings.xml ,但是从jcli的执行日志来看,并没有从我自己settings.xml里配置的mirror去下载依赖

确实是的,这个参数没有被用到。

https://github.com/search?q=repo%3Ajenkins-zh%2Fjenkins-cli%20MvnSettingsFile&type=code

感兴趣的话,在下面的代码处增加参数引用应该能解决这个问题: