Last active
March 10, 2019 12:22
-
-
Save ezhov-da/a617b5125d2571cfddada0d66e1e402f to your computer and use it in GitHub Desktop.
java maven properties from file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre> | |
Для того, чтоб иметь возможность в maven получать свойства из файла настроек в папке resources, | |
необходимо добавить плагин и использовать переменные в pom файле. | |
</pre> | |
[code:]LANG[:code] | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>properties-maven-plugin</artifactId> | |
<version>1.0.0</version> | |
<executions> | |
<execution> | |
<phase>initialize</phase> | |
<goals> | |
<goal>read-project-properties</goal> | |
</goals> | |
<configuration> | |
<files> | |
<file>src/main/resources/app.properties</file> | |
</files> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
[/code] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment