Repository navigation
[MNG-7914] Provide a single entry point for configuration - #1595
Conversation
There was a problem hiding this comment.
There is a conceptual problem here. There are only Maven user properties and Java system properties, but not Maven system properties. We are trying to get rid of them. That should clear in a new solution. I wouldn't even try to make system properties right. @slawekjaranowski
Yes, it makes sense. I've removed the system properties support to only keep |
|
There is one conceptual problem I have here: How does this relate to |
It's imho, a much better way to provide configuration properties. |
I see, then we also should educate users when to use what. |
Agreed. I suppose enhancing https://maven.apache.org/configure.html would be a first step. |
c7c6455 to
f658846
Compare
|
I will get back to this tomorrow. This is a crucial change which needs careful design. |
f658846 to
0cb4067
Compare
4481525 to
72e905d
Compare
| # Comma-separated list of files to include. | ||
| # Each item may be enclosed in quotes to gracefully include spaces. Items are trimmed before being loaded. | ||
| # If the first character of an item is a question mark, the load will silently fail if the file does not exist. | ||
| ${includes} = "?${maven.user.conf}/maven.properties", \ |
There was a problem hiding this comment.
Since you are quoting now the value, wouldn't it be more natural to put the question mark at the end? Unless you want to use "¿" as well. Maybe qoutes should be mandatory. Worth looking into Tomcat code for ths. I do not remember the motiviation.
There was a problem hiding this comment.
I'm not sure quotes are mandatory, but they certainly avoid any problem with spaces inside path.
About the location of the '?', I fear that putting it at end will be less prominent.
It's also the same syntax than for optional profiles, see https://maven.apache.org/guides/introduction/introduction-to-profiles.html#explicit-profile-activation
There was a problem hiding this comment.
I see your point. Shouldn't then the question mark be outside of the quotation marks to make the entire space-containing value optional?
There was a problem hiding this comment.
I've added support for moving the '?' before the quotes (both before and after are supported), the default config file moves them before.
|
my test in project looks like executed: It will be great to support user properties in such case to have a possibility: and |
I've added a unit test showing this now works. |
|
@michael-o @slawekjaranowski @cstamas any more comments on that one ? |
Will give it a spin again today |
michael-o
left a comment
There was a problem hiding this comment.
What is lacking completely is documentation how feature rich this approach is with inclusiion and optional files w/o reading source code.
| userProperties.stringPropertyNames().stream() | ||
| .filter(k -> !sys.contains(k)) | ||
| .forEach(k -> System.setProperty(k, userProperties.getProperty(k))); | ||
| } |
There was a problem hiding this comment.
We must seriously reconsider this promotion in the future before GA.
There was a problem hiding this comment.
The best we should not change a System property at all
There was a problem hiding this comment.
I've raised #1661 to assess if there are any failing ITs as a first step.
There was a problem hiding this comment.
Invoker and friends are our worst enemies here.
slawekjaranowski
left a comment
There was a problem hiding this comment.
evaluate properties from cmd
Could you expand a bit more ? |
more in comments: #1595 (review) here only as reason why I marek PR as require change |
Thx. I modified the UT and fixed the use case. |
slawekjaranowski
left a comment
There was a problem hiding this comment.
Looks ok for me.
We need to review documentation for it at all, generated and manually written.
# Conflicts: # maven-embedder/src/main/java/org/apache/maven/cli/props/MavenProperties.java
8ef8f9e to
d5946f0
Compare
|
Resolve #8731 |
No description provided.