292 字
1 分钟
wlp之如何配置liberty repository

参考链接

[Configuring repositories and proxy settings for the installUtility command——IBM Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_config_installutility.html)

wlp之如何配置liberty repository

创建liberty repository模板

你可以通过以下命令,查看repository的配置,如果你没有配置repository,则会返回配置模板给你
Terminal window
installUtility viewSettings

将返回的模板复制到地址 ${wlp.install.dir}/etc/repositories.properties ,没有etc目录要创建一个,没有properties要自己创建一个。

配置说明

禁用网络repository

```powershell useDefaultRepository=false ```

配置repository地址

windows
Terminal window
dev-rep.url=http://dev.repo.ibm.com:9080/ma/v1
local-rep2.url=file:///c:/IBM/localrepo2
local-rep3.url=C:\IBM\localrepo3
local-rep4.url=C:\IBM\localrepo4.zip

HP-UX、Solaris、Linux、Unix

Terminal window
dev-rep.url=http://dev.repo.ibm.com:9080/ma/v1
local-rep2.url=file:///usr/IBM/localrepo2
local-rep3.url=/usr/IBM/localrepo3
local-rep4.url=/usr/IBM/localrepo4.zip

如果Repository需要用户名密码

If a user name and password are required and they are not set, you receive a prompt to provide them. For enhanced security, encode the password by using the **securityUtility encode** action. For more information, see [Liberty: securityUtility command](https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_command_securityutil.html?view=kc).
Terminal window
dev-rep.user=myname
dev-rep.userPassword={aes}AH5NLyd7DfGb12pK17Pw+

如果你repository需要代理服务器

For enhanced security, encode the value of the `proxyPassword` property by using the **securityUtility encode** action. If you do not set the user name and password, you receive a prompt to provide them.
proxyHost=my.proxy.server.ibm.com
proxyPort=9080
proxyUser=myname
proxyPassword={aes}AH5NLyd7DfGb12pK17Pw+

查看验证repository验证信息

由于运行 `installUtility viewSettings` 会自动验证repository, `--viewValidationMessages` 选项可以查看详细的repository验证过程
Terminal window
installUtility viewSettings --viewValidationMessages

测试Repository

测试所有repository
Terminal window
installUtility testConnection

测试指定repository

Terminal window
installUtility testConnection <repository name>
wlp之如何配置liberty repository
https://iszengmh.pages.dev/posts/wlp之如何配置liberty-repository/
作者
Rise Zeng
发布于
2024-07-29
许可协议
CC BY-NC-SA 4.0