[英]How to resolve this - Failed to collect dependencies at org.postgresql:postgresql:jar:42.2.4
Could not resolve dependencies for project com.howtodoinjava:demo:jar:0.0.1-SNAPSHOT:
Failed to collect dependencies at org.postgresql:postgresql:jar:42.2.4: Failed to read artifact descriptor for org.postgresql:postgresql:jar:42.2.4: Could not transfer artifact org.postgresql:postgresql:pom:42.2.4 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/postgresql/postgresql/42.2.4/postgresql-42.2.4.pom: Unknown host No such host is known (repo.maven.apache.org) -> [Help 1]
Share your pom.xml
and application.properties
, anyway it should be something like:分享你的
pom.xml
和application.properties
,无论如何它应该是这样的:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
spring.datasource.url=jdbc:postgresql://localhost:5432/yourdatabasename
spring.datasource.username=postgres (this is default username)
spring.datasource.password=yourpassword
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.