-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
making possible to override environment variables by system properties #875
making possible to override environment variables by system properties #875
Conversation
@@ -63,6 +63,12 @@ | |||
<artifactId>xstream</artifactId> | |||
<version>1.4.7</version> | |||
</dependency> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I create a ValidationUtil
class to do this?
I believe that notBlank
method is something that we can use in many parts of the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use guava's Strings class:
On Tue Nov 11 2014 at 3:23:23 PM Nykolas Laurentino de Lima <
notifications@github.com> wrote:
In vraptor-core/pom.xml:
@@ -63,6 +63,12 @@
xstream
1.4.7
Should I create a ValidationUtil class to do this?
I believe that notBlank method is something that we can use in many parts
of the project.—
Reply to this email directly or view it on GitHub
https://github.com/caelum/vraptor4/pull/875/files#r20164752.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, I think this feature is great. And I also believe that during
development environment, the properties should be reloaded for every
request.
On Tue Nov 11 2014 at 3:26:25 PM Chico Sokol chico.sokol@gmail.com wrote:
We can use guava's Strings class:
On Tue Nov 11 2014 at 3:23:23 PM Nykolas Laurentino de Lima <
notifications@github.com> wrote:In vraptor-core/pom.xml:
@@ -63,6 +63,12 @@
xstream
1.4.7
Should I create a ValidationUtil class to do this?
I believe that notBlank method is something that we can use in many
parts of the project.—
Reply to this email directly or view it on GitHub
https://github.com/caelum/vraptor4/pull/875/files#r20164752.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, use @csokol suggestion. We can't add a new jar with a lot of classes only because one method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @csokol. I'll do this!
On Tuesday, November 11, 2014, csokol notifications@github.com wrote:
In vraptor-core/pom.xml:
@@ -63,6 +63,12 @@
xstream
1.4.7
We can use guava's Strings class:
http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Strings.html#isNullOrEmpty(java.lang.String)
… <#1499fe486c772a65_>
On Tue Nov 11 2014 at 3:23:23 PM Nykolas Laurentino de Lima <
notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote: In
vraptor-core/pom.xml: > @@ -63,6 +63,12 @@ >
xstream > 1.4.7 >
- Should I create a ValidationUtil class to do this? I believe that
notBlank method is something that we can use in many parts of the project.
— Reply to this email directly or view it on GitHub <
https://github.com/caelum/vraptor4/pull/875/files#r20164752>.—
Reply to this email directly or view it on GitHub
https://github.com/caelum/vraptor4/pull/875/files#r20164940.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take it easy @garcia-jj. Already understood.
On Tuesday, November 11, 2014, Otávio Garcia notifications@github.com
wrote:
In vraptor-core/pom.xml:
@@ -63,6 +63,12 @@
xstream
1.4.7
Yes, use @csokol https://github.com/csokol suggestion. We can't add a
new jar with a lot of classes only because one method.—
Reply to this email directly or view it on GitHub
https://github.com/caelum/vraptor4/pull/875/files#r20165131.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csokol About reload, sounds too fair. And its not too hard to implement. May we can do this feature in next pull request. What U think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it should be in different PR.
On Tue Nov 11 2014 at 3:31:57 PM Otávio Garcia notifications@github.com
wrote:
In vraptor-core/pom.xml:
@@ -63,6 +63,12 @@
xstream
1.4.7
@csokol https://github.com/csokol About reload, sounds too fair. And
its not too hard to implement. May we can do this feature in next pull
request. What U think?—
Reply to this email directly or view it on GitHub
https://github.com/caelum/vraptor4/pull/875/files#r20165314.
Just labeling this pull request conflicts with #821, so #821 needs to be refactored before merge into master. @nykolaslima What you think to add some docs about this search priority? |
@garcia-jj sure! Doing this right now.. |
Done. Can you review please @garcia-jj? My english isn't so good. |
Fixed. Thanks! Let's wait for review 👍 |
If you have a common properties for other environments you can create a file called `environment.properties` with these common properties. So VRaptor will ask for properties first in the environment file, and if not found, will ask in the `environment.properties` file. | ||
|
||
You can also override properties using System Properties. Properties defined by System Properties will override any other definitions. | ||
Note: You can only use System Properties to override existing properties in property files and not to define a new one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nykolaslima, can you just add an simple example?
I think It'll help users to get the idea. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice...Gonna do it!
👍 |
@Turini what do you think now? |
@Turini done. If you have any other suggestion please let me know. 👍 |
…em-property making possible to override environment variables by system properties
thank you @nykolaslima |
No problem. Thank you! |
When we are deploying in an environment like Amazon, we may need to update an environment variable on demand. Nowadays, we need to change the
environment.properties
in order to make this happen.This pull request, allow us to override this properties using system properties.
We only allow user's to override properties that exists in
environment.properties
and do not allow to define only in system property.