spring-cloud / spring-cloud-vault

Configuration Integration with HashiCorp Vault
http://cloud.spring.io/spring-cloud-vault/
Apache License 2.0
272 stars 151 forks source link

Spring Cloud Vault incompatible with spring-cloud version 2020.0.2 (method createSslConfiguration does not exist) #596

Closed lwiddershoven closed 3 years ago

lwiddershoven commented 3 years ago

Describe the bug

I create my project on start.spring.io, adding only vault. The generated pom has <spring-cloud.version>2020.0.2</spring-cloud.version> (notice the .2) for spring-cloud-dependencies and uses the spring-cloud-starter-vault-config dependency.

On mvn clean install the test fails to start the application context with

An attempt was made to call a method that does not exist. The attempt was made from the following location:

  org.springframework.cloud.vault.config.VaultConfiguration.createSslConfiguration(VaultConfiguration.java:101)

The following method did not exist:

  'void org.springframework.vault.support.SslConfiguration.<init>(org.springframework.vault.support.SslConfiguration$KeyStoreConfiguration, org.springframework.vault.support.SslConfiguration$KeyStoreConfiguration, java.util.List, java.util.List)'

The method's class, org.springframework.vault.support.SslConfiguration, is available from the following locations:

  jar:file:/Users/hlmwiddershoven/.m2/repository/org/springframework/vault/spring-vault-core/2.3.0/spring-vault-core-2.3.0.jar!/org/springframework/vault/support/SslConfiguration.class

The class hierarchy was loaded from the following locations:

  org.springframework.vault.support.SslConfiguration: file:/Users/hlmwiddershoven/.m2/repository/org/springframework/vault/spring-vault-core/2.3.0/spring-vault-core-2.3.0.jar

If I change the spring cloud version to 2020.0.1 the application starts, and even works if I set @SpringBootTest(properties = "spring.cloud.vault.token=123" ) on the generated test class.

Sample Go to start.spring.io and create an app with just vault, and check that the spring cloud version is 2020.0.2.

mp911de commented 3 years ago

Spring Cloud 2020.0.2, specifically Spring Cloud Config, pulls in an outdated version of Spring Vault. The SslConfiguration constructor was introduced with Spring Vault 2.3.2.

See https://github.com/spring-cloud/spring-cloud-config/commit/20be22eced2700e257c3ebf1ae65a300570db824 for reference.