1、[INFO] Ambari Admin View .................................. FAILURE
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Bower install) on project ambari-admin: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Bower install) on project ambari-admin: Command execution failed.
单独编译报错:
ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/twbs/bootstrap.git", exit code of #128
Additional error details:
fatal: unable to access 'https://github.com/twbs/bootstrap.git/': Peer reports incompatible or unsupported protocol version.
解决:个人将ambari-admin(包括子目录ambari-admin/src/main/resources/ui/admin-web)里面生成的node、node_modules、package-lock.json删除,保持干净的源码环境,再单独编译ambari-admin
#cd ambari-admin/src/main/resources/ui/admin-web目录下,编辑 .bowerrc ,修改后的内容如下:
{
"directory": "app/bower_components",
"allow_root": true
}
在上述目录下,安装npm依赖包,全局安装gulp、bower
#npm install
#npm install -g bower
#npm install -g gulp
安装bower的依赖包(个人在ambari-admin/src/main/resources/ui/admin-web/下执行)
bower install
(上述错误原因在于bower install命令失败,个人将之前成功编译的bower_components目录(ambari-admin/src/main/resources/ui/admin-web/app目录下)拷贝到ambari-release-2.6.1/ambari-admin/src/main/resources/ui/admin-web/app目录下,再次运行成功)
安装 gulp-webserver
npm install gulp-webserver --save-dev
运行命令mvn install -Drat.skip=true -Preplaceurl -X重新单独编译ambari-admin模块(此命令在ambari-admin目录下运行)
2、ambari-metrics编译时间过长,可修改pom.xml再进行编译(个人通过设置本地仓库下载,提高效率)
如下面ambari/ambari-metrics目录下的pom.xml文件:
3、ava.util.ArrayList -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:3.0.3:findbugs (findbugs) on project ambari-server: Unable to parse configuration of mojo org.codehaus.mojo:findbugs-maven-plugin:3.0.3:findbugs for parameter pluginArtifacts: Cannot assign configuration entry 'pluginArtifacts' with value '${plugin.artifacts}' of type java.util.Collections.UnmodifiableRandomAccessList to property of type java.util.ArrayList
解决方法:
先单独编译ambari-server模块
# cd ambari-server
# mvn versions:set -DnewVersion=2.6.1.0.0
# find ~/.m2/repository/ -name "*.lastUpdated" -exec rm -rf {} \;
# mvn package -Dbuild-rpm -Drat.skip=true -DskipTests
否则,兼容性问题,将 maven降至3.5.4以下版本 或者 将findbugs-maven-plugin版本升级到3.0.5
最终编译结果: