Fix GitCommitId example

This commit is contained in:
Grzegorz Piwowarek
2016-08-15 11:47:01 +02:00
parent ad9986874f
commit c2e999f09f
2 changed files with 18 additions and 6 deletions

View File

@@ -2,13 +2,25 @@ package com.baeldung.git;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.ClassPathResource;
@PropertySource(value = "classpath:/git.properties", ignoreResourceNotFound = true)
@SpringBootApplication(scanBasePackages = { "com.baeldung.git"})
public class CommitIdApplication {
public static void main(String[] args) {
SpringApplication.run(CommitIdApplication.class, args);
}
@Bean
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
c.setLocation(new ClassPathResource("git.properties"));
c.setIgnoreResourceNotFound(true);
c.setIgnoreUnresolvablePlaceholders(true);
return c;
}
}