我按照此处提到的说明进行操作:https://medium.com/@valeryyakovlev/embedded-postgres-test-config-ab8e4e0d3256
当我在本地运行时,它工作正常,但是在gitlab CI上构建时,出现以下错误。
Caused by:
org.springframework.beans.BeanInstantiationException: Failed to instantiate [ru.yandex.qatools.embed.postgresql.EmbeddedPostgres]: Factory method 'embeddedPostgres' threw exception; nested exception is de.flapdoodle.embed.process.exceptions.DistributionException: java.io.IOException: Could not open inputStream for http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz
Caused by:
de.flapdoodle.embed.process.exceptions.DistributionException: java.io.IOException: Could not open inputStream for http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz
Caused by:
java.io.IOException: Could not open inputStream for http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz
Caused by:
java.io.IOException: Server returned HTTP response code: 403 for URL: http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz
Gradle Test Executor 1 finished executing tests.
我发现一些来源提到自定义代理:https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo#customize-proxy-for-download
它没有帮助。