编辑
在使用maven-assembly-plugin的<filtered>true</filtered>
功能时,我遇到了一个奇怪的参数。
输入:
some unfiltered text
foo expands to '${params.foo}'
bar expands to '${params.bar}'
"..." expands to '${...}'
输出:
some unfiltered text
foo expands to 'FOO'
bar expands to 'BAR'
"..." expands to 'MavenProject: net.jsharp:assembly-example:1 @ /path/to/my/code/pom.xml'
params.foo
和params.bar
在我的pom.xml
中被定义。然而,...
没有被定义。我找不到任何可能定义它的settings.xml,所以它似乎是来自于超级pom或者是由过滤参数扩展的特殊性质引起的,但我无法弄清楚它是什么。在mvn help:effective-pom
中也没有任何迹象。
这个神秘的${...}
变量是什么?
可重现的示例在这里:https://gist.github.com/jpassaro/0892106beca2a066fae21320be41dcbf
原始问题(及其上下文)
在一些shell脚本中,我需要插值maven属性。我使用以下方式实现:
# '${...}' vars should be understood as being populated by maven
foo='${project.foo}'
bar='${project.bar}'
令我大为惊讶的是,当它通过汇编器运行时,会出现以下情况:
# 'MavenProject: <group-id>:<artifact-id>:<version> @ <path-to-project>/dependency-reduced-pom.xml' vars should be understood as being populated by maven
foo='FOO'
bar='BAR'
这个神秘的
${...}
变量是什么?(maven 3.5.4,OSX,java 1.8)