如何将Openshift默认的Maven版本从3.0.4升级到3.1.0?

3

Maven插件frontend-maven-plugin:0.0.23需要maven 3.1.0,但openshift默认只有3.0.4。

以下是在向openshift进行“git push”时出现的Maven错误:

remote: [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.23:install-node
-and-npm (install node and npm) on project taxtab-controllers: The plugin com.github.eirslett:fronte
nd-maven-plugin:0.0.23 **requires Maven version 3.1.0** -> [Help 1]

我尝试以下步骤来解决构建问题:

  1. 我在 $OPENSHIFT_HOMEDIR\app-root\runtime\apache-maven 中安装了最新的maven 3.3.1。
  2. 我尝试在 pre_build 和 build 两个 action hooks 中添加以下导出内容,但仍未解决问题。

export M2_HOME=/var/lib/openshift/5497cdff4382ec255f00002c/app-root/runtime/apache-maven/apache-maven-3.3.1 export M2=$M2_HOME/bin export PATH=$M2:$PATH

我还尝试在 ~/app-root/data/ 中添加 .bash_profile,包含以上变量设置,但仍未解决问题。

1个回答

2

我也遇到了同样的问题。降低插件版本解决了这个问题:

<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.22</version>

与其使用 0.0.23 版本,不如……

然而,我接下来遇到了另一个问题,即由于缺乏 root 权限,npm 安装无法正常运行。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接