1

I've been looking for documentation on the maven expression syntax.

I managed to find the plexus-interpolation module which seems to do the work, but its documentation is pretty sparse.

Is there any documentation on the expression format better than the unittests?

https://codehaus-plexus.github.io/plexus-interpolation/ has some usage information, which suggests that the Regex based interpolator as the preferred one.

Mike Samuel
  • 118,113
  • 30
  • 216
  • 245
  • What do you mean? Do you mean `${...}`? – Tunaki Mar 03 '16 at 16:10
  • @Tunaki, `${...}` and `...` if those unit-tests are to be believed. – Mike Samuel Mar 03 '16 at 16:12
  • Are you looking for this then? https://maven.apache.org/pom.html#Properties I'm not sure I understand your question. – Tunaki Mar 03 '16 at 16:13
  • @Tunaki, that seems to explain the ValueSources available for interpolation within a POM IIUC. Except for a very short comment about `${X}` notation, it doesn't talk about the expression language at all, about prefix stripping, about nested expressions, why and how recursive expression evaluation causes trouble in practice. – Mike Samuel Mar 03 '16 at 16:16
  • I don't understand at all what you want to do. Could you explain what your end-goal is? What's the context? "maven expression syntax" is pretty unclear. – Tunaki Mar 03 '16 at 16:21
  • @Tunaki, I am writing a number of enforcer rules and plugins. I need to provide documentation on how to configure these. Part of the API is human-readable error messages that can interpolate values from the current `MavenProject`'s artifact's POM along with other properties that represent intermediate values. As part of this documentation, I would like to refer to some documentation that describes the interpolator expression syntax. This is a widely used piece of machinery, and there are so many questions about how to do things like escape `$` that the lack of a grammar anywhere seems odd. – Mike Samuel Mar 03 '16 at 16:26
  • @MikeSamuel The things like `..`within the tests are examples what kind of delimiters can be used. Furthermore related to your plans of enforcer. The result output of an enforcer rules already prints out information about g:a:v etc. The question is what you like to do ? May be you have an real example ? What kind of Plugin do you write? What kind of functionality is missing? – khmarbaise Mar 03 '16 at 17:33
  • @khmarbaise, I am not missing functionality in the plugin I'm writing; I am missing documentation. A grammar would answer questions like the kinds of delimiters used, and what goes within the delimiters. These comments seem to assume that this is some incredibly simple micro-language. If that is the case, then it should be possible to document it very succinctly, and to document what variants like `\${X}` mean. That most of the documentation that tries to explain this micro-language is missing 2 of 3 forms (the tag form and the escaping convention) suggests that it is not well understood. – Mike Samuel Mar 03 '16 at 17:57
  • Hm..If you don't miss functionality than why do you write plugins? What about https://maven.apache.org/plugins/maven-resources-plugin/examples/escape-filtering.html ? – khmarbaise Mar 03 '16 at 18:34
  • @khmarbaise, Thanks for the link. While English is a language that's meant to be broken, it is unclear to me what "This means expression ${ } and @ @ preceded will replace by the expression : \${java.home} -> ${java.home}" means. – Mike Samuel Mar 03 '16 at 18:39
  • This means if you use an expression `\${java.home}` which means that during the filtering it is not replaced by its value (in this case by the java.home) it is replaced by `${java.home}` so this can be used for further steps. This should be taken in relationship with https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html. – khmarbaise Mar 03 '16 at 18:48
  • @khmarbaise, I understand that that is the case because I've seen it better explained [elsewhere](http://stackoverflow.com/a/33739042/20394). My complaint is that that documentation is badly written. – Mike Samuel Mar 03 '16 at 20:19
  • So it would be a good idea instead of complaining fill out a JIRA issue or make post on the user/dev list of Maven and best would be to offer a patch for existing documentation of create a new part ....and make it better. – khmarbaise Mar 04 '16 at 06:11
  • @khmarbaise, and which existing documentation would I patch? Where is the expression syntax documented or where should it be documented? – Mike Samuel Mar 04 '16 at 16:17
  • @khmarbaise, I think I may have been coming across dickish. Sorry about that. I agree that improving documentation is good, but was hoping to avoid duplicating someone else's work. I appreciate the attempt to find existing documentation which explains things. I've already pieced the picture together from similar sources, so those sources don't help me. I thin k the answer to my question is "no" and I'll post an issue to see where people think such docs should live now that I think I'm in a position to write them. – Mike Samuel Mar 04 '16 at 17:36

0 Answers0