Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:22
Show Gist options
  • Save ezhov-da/a617b5125d2571cfddada0d66e1e402f to your computer and use it in GitHub Desktop.
Save ezhov-da/a617b5125d2571cfddada0d66e1e402f to your computer and use it in GitHub Desktop.
java maven properties from file
<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