Pergunta

I'm wondering what is the best way to organize Spring Configurator directories in my Maven project ? I wan't to have prod,dev and test config sets with seperate *.xml and *.conf files. And also I'd like to have a seperate master *.xml file that is used in every config set.

Do I have to place *.xml and *.conf files in seperate directories ? Or could I just places them in the same dir , like so:

spring/
  test/application.xml
  test/params.conf
  dev/application.xml
  dev/params.conf
  prod/application.xml
  prod/params.conf

Thanks for help :)

Foi útil?

Solução

Place them in a directory structure in a way that no redundancy exist on classpath. Eg: if your code searches for */application.xml file and you have all 3 on the classpath it will cause confusion

Also leverage the use of Maven build profile and assembly plugin. Configure it such that only relevant files are packaged for each build profile.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top