且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Maven build-helper-maven-plugin 正则表达式无法使用属性作为dependency.version

更新时间:2023-09-30 13:39:58

我遇到了类似的情况,但是用 -D 覆盖不是解决方案(只是不要问),因为我有一些变量,配置文件也没有.

I was kind of in a similar situation, but an override with -D is no solution (just don't ask) and since I've got a few variables, profiles are none either.

就我而言,它是这样的:fabric8 docker maven 插件使用一个变量.该变量由build-helper-maven-plugin"正则表达式属性生成.

In my case it's like this: The fabric8 docker maven plugin uses a variable. That variable is generated by the "build-helper-maven-plugin" regex-property.

如果调用了mvn docker:build",则不会使用验证阶段并且变量不存在(所以我得到一个${blabla}"文字)并且构建失败.如果我调用通常的构建,就会创建变量.

If "mvn docker:build" is invoked, the validate phase is not used and the variable is not there (so I get a "${blabla}" literal) and the build fails. If I invoke the usual build, the variable gets created.

我采取了运行mvn validate docker:build"而不是mvn docker:build"的策略来强制执行验证步骤,因此创建了变量.

I took the strategy to run "mvn validate docker:build" instead of "mvn docker:build" to force the validation step, so the variable gets created.