Ambari 1.7 源码编译笔记

环境CentOS 6.5

1.安装jdk

[[email protected] zzh]# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm

[[email protected] zzh]# rpm -ivh jdk-7u79-linux-x64.rpm

环境变量 :

[[email protected] zzh]# vi /etc/profile

JAVA_HOME=/usr/java/jdk1.7.0_79

JRE_HOME=/usr/java/jdk1.7.0_79/jre

PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

CLASSPATH=.:$JAVA_HOME/lib.dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib

export JAVA_HOME JRE_HOME PATH CLASSPATH

2. 安装maven 3.0.5

下载 apache-maven-3.0.5-bin.tar.gz

[[email protected] zzh]# tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /opt

[[email protected] zzh]# cd /opt

[[email protected] opt]# ln -s /opt/apache-maven-3.0.5 maven

环境变量:

vi /etc/profile

MAVEN_HOME=/opt/maven

PATH=$PATH:$MAVEN_HOME/bin

3. 安装python2.6

4.安装  rpm-build

[[email protected] zzh]# yum install rpm-build

5.安装gcc-c++

[[email protected] zzh]# rpm -qa | grep gcc-c++

[[email protected] zzh]# yum install gcc-c++

6.安装 nodejs

[[email protected] zzh]# wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-x64.tar.gz

[[email protected] zzh]# tar -zxvf node-v0.10.26-linux-x64.tar.gz -C /opt

[[email protected] zzh]# cd /opt

[[email protected] opt]# ln -s node-v0.10.26-linux-x64 node

环境变量:

[[email protected] opt]# vi /etc/profile

NODE_HOME=/opt/node

PATH=$PATH:NODE_HOME/bin

[[email protected] zzh]# source /etc/profile

检查

[[email protected] zzh]# node -v

v0.10.26

[[email protected] zzh]# npm -v

1.4.3

7.安装brunch

[[email protected] zzh]# npm install -g brunch@1.7.20

npm http GET https://registry.npmjs.org/brunch/1.7.20

npm http 200 https://registry.npmjs.org/brunch/1.7.20

....

/opt/node/bin/brunch -> /opt/node/lib/node_modules/brunch/bin/brunch

[email protected] /opt/node/lib/node_modules/brunch

├── [email protected]

├── [email protected]

├── [email protected]

├── [email protected]

├── [email protected]

├── [email protected]

├── [email protected]

├── [email protected]

├── [email protected] ([email protected])

├── [email protected] ([email protected])

├── [email protected] ([email protected])

├── [email protected] ([email protected])

├── [email protected] ([email protected])

├── [email protected] ([email protected], [email protected], [email protected])

├── [email protected] ([email protected])

└── [email protected] ([email protected], [email protected])

8.安装setuptools

[[email protected] zzh]# wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-12.0.3.tar.gz#md5=f07e4b0f4c1c9368fcd980d888b29a65

[[email protected] zzh]# tar -zxvf setuptools-12.0.3.tar.gz

[[email protected] zzh]# cd setuptools-12.0.3

[[email protected] zzh]# python setup.py install

8.获取ambari1.7.0源码并编译

[[email protected] zzh]# wget https://github.com/apache/ambari/archive/release-1.7.0.zip

[[email protected] zzh]# unzip release-1.7.0

[[email protected] zzh]# cd ambari-release-1.7.0/

[[email protected] ambari-release-1.7.0]# mvn versions:set -DnewVersion=1.7.0.0

[[email protected] ambari-release-1.7.0]# mvn -B clean install package rpm:rpm -DnewVersion=1.7.0.0 -DskipTests -Dpython.ver="python>= 2.6"

如果出现域名不能解析的情况

vi /etc/resolv.conf,增加

nameserver 8.8.8.8

nameserver 202.106.196.115

另,安装过程中出现了很多错误,解决过程记录如下:

错误1: --版本不匹配

[INFO]

[INFO] --- build-helper-maven-plugin:1.8:regex-property (parse-package-version) @ ambari ---

[INFO] No match to regex ‘^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*‘ found in ‘1.7.0‘. The initial value ‘1.7.0‘ is left as-is...

[INFO]

[INFO] --- build-helper-maven-plugin:1.8:regex-property (parse-package-release) @ ambari ---

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] Ambari Main ....................................... FAILURE [1.526s]

[INFO] Apache Ambari Project POM ......................... SKIPPED

[INFO] Ambari Web ........................................ SKIPPED

[INFO] Ambari Views ...................................... SKIPPED

[INFO] Ambari Admin View ................................. SKIPPED

[INFO] Ambari Server ..................................... SKIPPED

[INFO] Ambari Agent ...................................... SKIPPED

[INFO] Ambari Client ..................................... SKIPPED

[INFO] Ambari Python Client .............................. SKIPPED

[INFO] Ambari Groovy Client .............................. SKIPPED

[INFO] Ambari Shell ...................................... SKIPPED

[INFO] Ambari Python Shell ............................... SKIPPED

[INFO] Ambari Groovy Shell ............................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 3.846s

[INFO] Finished at: Fri Jan 29 06:57:20 PST 2016

[INFO] Final Memory: 8M/19M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:build-helper-maven-plugin:1.8:regex-property (parse-package-release) on project ambari: No match to regex ‘^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-)(([0-9]+)|(SNAPSHOT)).*‘ found in ‘1.7.0‘. -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

解决办法:

之前将1.7.0.0手误写成1.7.0导致,改成-DnewVersion=1.7.0.0即可

当然,也可以修改pom.xml代码:

[[email protected] ambari-release-1.7.0]# vi pom.xml

搜索“SNAPSHOT“,定位到111行: <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-)(([0-9]+)|(SNAPSHOT)).*</regex>

将之后的113行改为: <failIfNoMatch>false</failIfNoMatch>

[[email protected] ambari-release-1.7.0]# mvn -B clean install package rpm:rpm -DnewVersion=1.7.0 -DskipTests -Dpython.ver="python>= 2.6"

9. 错误2:安装过程中发现phantomjs无法下载--需手动安装phantomjs

[exec] > [email protected] install /root/zzh/ambari-1.7.0/ambari-web/node_modules/phantomjs

[exec] > node install.js

[exec]

[exec]

[exec]

[exec] PhantomJS not found on PATH

[exec] Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2

[exec] Saving to /root/zzh/ambari-1.7.0/ambari-web/node_modules/phantomjs/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2

[exec] Receiving...

[exec]

[exec]

[exec] Error making request.

[exec] Error: read ECONNRESET

[exec]     at errnoException (net.js:904:11)

[exec]     at TCP.onread (net.js:558:19)

..........................................................

INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] Ambari Web ........................................ FAILURE [11:58.242s]

[INFO] Ambari Views ...................................... SKIPPED

[INFO] Ambari Admin View ................................. SKIPPED

[INFO] Ambari Server ..................................... SKIPPED

[INFO] Ambari Agent ...................................... SKIPPED

[INFO] Ambari Client ..................................... SKIPPED

[INFO] Ambari Python Client .............................. SKIPPED

[INFO] Ambari Groovy Client .............................. SKIPPED

[INFO] Ambari Shell ...................................... SKIPPED

[INFO] Ambari Python Shell ............................... SKIPPED

[INFO] Ambari Groovy Shell ............................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 12:00.978s

[INFO] Finished at: Fri Jan 29 07:50:00 PST 2016

[INFO] Final Memory: 8M/19M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (compile) on project ambari-web: An Ant BuildException has occured: exec returned: 8

[ERROR] around Ant part ...<exec dir="/root/zzh/ambari-1.7.0/ambari-web" executable="brunch" failonerror="true">... @ 8:88 in /root/zzh/ambari-1.7.0/ambari-web/target/antrun/build-ambari-web-compile.xml

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

解决办法:

手动安装对应版本的phantomjs

[[email protected] zzh]# wget http://npm.taobao.org/mirrors/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2

[[email protected] zzh]# vi /etc/profile

PHANTOMJS_HOME=/opt/phantomjs

PATH=$PATH:$PHANTOMJS_HOME/bin

[[email protected] zzh]# source /etc/profile

[[email protected] ambari-release-1.7.0]# mvn -B clean install package rpm:rpm -DnewVersion=1.7.0.0 -DskipTests -Dpython.ver="python>= 2.6" -rf ambari-web

错误3:安装过程中发现还是有错误,切换taobao的npm源:

[[email protected] ambari-release-1.7.0]# npm config get registry

npm config set registry  https://registry.npmjs.org/

[[email protected] ambari-release-1.7.0]# npm config set registry https://registry.npm.taobao.org [[email protected] ambari-release-1.7.0]# npm info underscore (如果上面配置正确这个命令会有字符串response)

错误4:gyp: /root/.node-gyp/0.10.26/common.gypi not found

[exec]

[exec] > [email protected] install /root/zzh/ambari-1.7.0/ambari-web/node_modules/karma-ember-precompiler-brunch/node_modules/jsdom/node_modules/contextify

[exec] > node-gyp rebuild

[exec]

[exec] npm http GET https://registry.npm.taobao.org/brace-expansion

[exec] gyp: /root/.node-gyp/0.10.26/common.gypi not found (cwd: /root/zzh/ambari-1.7.0/ambari-web/node_modules/karma-ember-precompiler-brunch/node_modules/jsdom/node_modules/contextify) while reading includes of binding.gyp

[exec] gyp ERR! configure error

[exec] gyp ERR! stack Error: `gyp` failed with exit code: 1

[exec] gyp ERR! stack     at ChildProcess.onCpExit (/opt/node-v0.10.26-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)

[exec] gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)

[exec] gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)

[exec] gyp ERR! System Linux 2.6.32-431.el6.x86_64

[exec] gyp ERR! command "node" "/opt/node-v0.10.26-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

[exec] gyp ERR! cwd /root/zzh/ambari-1.7.0/ambari-web/node_modules/karma-ember-precompiler-brunch/node_modules/jsdom/node_modules/contextify

[exec] gyp ERR! node -v v0.10.26

[exec] gyp ERR! node-gyp -v v0.12.2

[exec] gyp ERR! not ok

解决办法:

[[email protected] ~]# rm ~/.node-gyp/ -rf

[[email protected] ambari-release-1.7.0]# mvn -B clean install package rpm:rpm -DnewVersion=1.7.0.0 -DskipTests -Dpython.ver="python>= 2.6" -rf ambari-web

错误5. 依赖项错误

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] Ambari Main ....................................... SUCCESS [24.486s]

[INFO] Apache Ambari Project POM ......................... SUCCESS [2.171s]

[INFO] Ambari Web ........................................ SUCCESS [4:03.923s]

[INFO] Ambari Views ...................................... SUCCESS [32.005s]

[INFO] Ambari Admin View ................................. SUCCESS [2:53.443s]

[INFO] Ambari Server ..................................... FAILURE [13:30.971s]

[INFO] Ambari Agent ...................................... SKIPPED

[INFO] Ambari Client ..................................... SKIPPED

[INFO] Ambari Python Client .............................. SKIPPED

[INFO] Ambari Groovy Client .............................. SKIPPED

[INFO] Ambari Shell ...................................... SKIPPED

[INFO] Ambari Python Shell ............................... SKIPPED

[INFO] Ambari Groovy Shell ............................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 21:29.129s

[INFO] Finished at: Wed Feb 17 04:52:34 PST 2016

[INFO] Final Memory: 31M/76M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project ambari-server: Could not resolve dependencies for project org.apache.ambari:ambari-server:jar:1.7.0.0: Failed to collect dependencies for [org.apache.ambari:ambari-views:jar:1.7.0.0 (compile), commons-io:commons-io:jar:2.1 (compile), com.google.inject.extensions:guice-assistedinject:jar:3.0 (compile), com.google.inject.extensions:guice-persist:jar:3.0 (compile), com.google.inject.extensions:guice-servlet:jar:3.0 (compile), com.google.inject.extensions:guice-multibindings:jar:3.0 (compile), org.apache.derby:derby:jar:10.9.1.0 (compile), org.springframework.security:spring-security-core:jar:3.1.2.RELEASE (compile), org.springframework.security:spring-security-config:jar:3.1.2.RELEASE (compile), org.springframework.security:spring-security-web:jar:3.1.2.RELEASE (compile), org.springframework:spring-mock:jar:2.0.8 (test), org.springframework.security:spring-security-ldap:jar:3.1.2.RELEASE (compile), org.springframework.ldap:spring-ldap-core:jar:1.3.1.RELEASE (compile), org.apache.directory.server:apacheds-core:jar:1.5.5 (compile), org.apache.directory.server:apacheds-protocol-ldap:jar:1.5.5 (compile), org.apache.directory.shared:shared-ldap:jar:0.9.17 (compile), org.slf4j:slf4j-api:jar:1.7.2 (compile), org.slf4j:slf4j-log4j12:jar:1.7.2 (compile), log4j:log4j:jar:1.2.16 (compile), org.eclipse.persistence:eclipselink:jar:2.4.0 (compile), org.mockito:mockito-core:jar:1.8.5 (test), org.eclipse.jetty:jetty-security:jar:7.6.7.v20120910 (compile), org.eclipse.jetty:jetty-servlet:jar:7.6.7.v20120910 (compile), org.eclipse.jetty:jetty-webapp:jar:7.6.7.v20120910 (compile), org.eclipse.jetty:jetty-server:jar:7.6.7.v20120910 (compile), commons-logging:commons-logging:jar:1.1.1 (compile), commons-codec:commons-codec:jar:1.8 (compile), commons-lang:commons-lang:jar:2.5 (compile), commons-httpclient:commons-httpclient:jar:3.1 (compile), commons-net:commons-net:jar:1.4.1 (compile), javax.servlet:servlet-api:jar:2.5 (compile), com.sun.jersey:jersey-json:jar:1.11 (compile), com.sun.jersey:jersey-server:jar:1.11 (compile), com.sun.jersey:jersey-client:jar:1.11 (compile), com.sun.jersey.contribs:jersey-multipart:jar:1.11 (compile), com.sun.jersey.contribs:jersey-guice:jar:1.11 (compile), org.codehaus.jackson:jackson-mapper-asl:jar:1.9.2 (compile), org.codehaus.jackson:jackson-core-asl:jar:1.9.9 (compile), org.codehaus.jackson:jackson-jaxrs:jar:1.9.9 (compile), org.codehaus.jackson:jackson-xc:jar:1.9.9 (compile), com.sun.jersey.jersey-test-framework:jersey-test-framework-core:jar:1.11 (test), com.sun.jersey.jersey-test-framework:jersey-test-framework-grizzly2:jar:1.11 (test), org.codehaus.jettison:jettison:jar:1.1 (test), junit:junit:jar:4.10 (test), org.easymock:easymock:jar:3.1 (test), org.powermock:powermock-core:jar:1.5 (test), org.powermock:powermock-reflect:jar:1.5 (test), org.powermock:powermock-api-easymock:jar:1.5 (test), org.powermock:powermock-module-junit4:jar:1.5 (test), org.objenesis:objenesis-tck:jar:1.2 (compile), cglib:cglib:jar:2.2.2 (compile), asm:asm:jar:3.3.1 (compile), com.google.inject:guice:jar:3.0 (compile), com.google.code.gson:gson:jar:2.2.2 (compile), org.postgresql:postgresql:jar:9.3-1101-jdbc4 (compile), org.apache.httpcomponents:httpclient:jar:4.2.5 (compile), com.google.guava:guava:jar:14.0.1 (compile), com.google.code.findbugs:jsr305:jar:1.3.9 (compile), org.quartz-scheduler:quartz:jar:2.2.1 (compile), org.quartz-scheduler:quartz-jobs:jar:2.2.1 (compile), org.apache.velocity:velocity:jar:1.7 (compile)]: Failed to read artifact descriptor for com.sun.jersey:jersey-core:jar:1.11: Could not transfer artifact com.sun.jersey:jersey-core:pom:1.11 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :ambari-server

解决办法:

默认的maven镜像有问题,一些包下载不下来,网上搜索了一下,增加两个mirror

vi /opt/maven/conf/setting.xml

<mirror>

<id>jboss-public-repository-group</id>

<mirrorOf>central</mirrorOf>

<name>JBoss Public Repository Group</name>

<url>http://repository.jboss.org/nexus/content/groups/public</url>

</mirror>

<mirror>

<id>ibiblio</id>

<mirrorOf>central</mirrorOf>

<name>Human Readable Name for this Mirror.</name>

<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>

</mirror>

使用下面命令继续:

[[email protected] ambari-1.7.0]# mvn -B clean install package rpm:rpm -DnewVersion=1.7.0.0 -DskipTests -Dpython.ver="python>= 2.6" -rf ambari-server

错误6:Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (python-package) on project ambari-agent

INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building Ambari Agent 1.7.0.0

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ambari-agent ---

[INFO] Deleting /root/zzh/ambari-1.7.0/ambari-agent (includes = [**/*.pyc], excludes = [])

[INFO]

[INFO] --- build-helper-maven-plugin:1.8:regex-property (parse-package-version) @ ambari-agent ---

[INFO]

[INFO] --- build-helper-maven-plugin:1.8:regex-property (parse-package-release) @ ambari-agent ---

[INFO]

[INFO] --- build-helper-maven-plugin:1.8:parse-version (parse-version) @ ambari-agent ---

[INFO]

[INFO] --- build-helper-maven-plugin:1.8:regex-property (regex-property) @ ambari-agent ---

[INFO]

[INFO] --- buildnumber-maven-plugin:1.2:create (default) @ ambari-agent ---

Downloading: http://download.java.net/maven/2/antlr/antlr/2.7.7/antlr-2.7.7.jar

Downloaded: http://download.java.net/maven/2/antlr/antlr/2.7.7/antlr-2.7.7.jar (0 B at 0.0 KB/sec)

[INFO] Checking for local modifications: skipped.

[INFO] Updating project files from SCM: skipped.

[INFO] Executing: /bin/sh -c cd /root/zzh/ambari-1.7.0/ambari-agent && git rev-parse --verify HEAD

[INFO] Working directory: /root/zzh/ambari-1.7.0/ambari-agent

[INFO] Storing buildNumber: null at timestamp: 1455732001279

[INFO] Executing: /bin/sh -c cd /root/zzh/ambari-1.7.0/ambari-agent && git rev-parse --verify HEAD

[INFO] Working directory: /root/zzh/ambari-1.7.0/ambari-agent

[INFO] Storing buildScmBranch: UNKNOWN_BRANCH

[INFO]

[INFO] --- exec-maven-plugin:1.2:exec (python-test) @ ambari-agent ---

[INFO] skipping execute as per configuraion

[INFO]

[INFO] --- apache-rat-plugin:0.11:check (default) @ ambari-agent ---

[INFO] 51 implicit excludes (use -debug for more details).

[INFO] Exclude: src/examples/*

[INFO] Exclude: src/test/python/dummy*.txt

[INFO] Exclude: src/test/python/ambari_agent/dummy_files/*

[INFO] Exclude: src/test/python/ambari_agent/dummy*.txt

[INFO] Exclude: src/main/python/ambari_agent/imports.txt

[INFO] Exclude: **/*.erb

[INFO] Exclude: **/*.json

[INFO] Exclude: **/*.pydevproject

[INFO] 105 resources included (use -debug for more details)

Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property ‘http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit‘ is not recognized.

Compiler warnings:

WARNING:  ‘org.apache.xerces.jaxp.SAXParserImpl: Property ‘http://javax.xml.XMLConstants/property/accessExternalDTD‘ is not recognized.‘

Warning:  org.apache.xerces.parsers.SAXParser: Feature ‘http://javax.xml.XMLConstants/feature/secure-processing‘ is not recognized.

Warning:  org.apache.xerces.parsers.SAXParser: Property ‘http://javax.xml.XMLConstants/property/accessExternalDTD‘ is not recognized.

Warning:  org.apache.xerces.parsers.SAXParser: Property ‘http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit‘ is not recognized.

[INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 105 licence.

[INFO]

[INFO] --- maven-assembly-plugin:2.2-beta-5:single (build-tarball) @ ambari-agent ---

[INFO] Reading assembly descriptor: src/packages/tarball/all.xml

[INFO] Copying files to /root/zzh/ambari-1.7.0/ambari-agent/target/ambari-agent-1.7.0.0

[WARNING] Assembly file: /root/zzh/ambari-1.7.0/ambari-agent/target/ambari-agent-1.7.0.0 is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment.

[INFO]

[INFO] --- maven-resources-plugin:2.6:copy-resources (copy-resources) @ ambari-agent ---

[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.

[INFO] Copying 880 resources

[INFO]

[INFO] --- maven-resources-plugin:2.6:copy-resources (copy-resources-filter) @ ambari-agent ---

[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.

[INFO] Copying 1 resource

[INFO] Copying 1 resource

[INFO]

[INFO] --- maven-assembly-plugin:2.2-beta-5:single (make-assembly) @ ambari-agent ---

[INFO] Reading assembly descriptor: src/packages/tarball/all.xml

[INFO] Copying files to /root/zzh/ambari-1.7.0/ambari-agent/target/ambari-agent-1.7.0.0

[WARNING] Assembly file: /root/zzh/ambari-1.7.0/ambari-agent/target/ambari-agent-1.7.0.0 is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment.

[INFO]

[INFO] --- exec-maven-plugin:1.2:exec (python-package) @ ambari-agent ---

Traceback (most recent call last):

File "/root/zzh/ambari-1.7.0/ambari-agent/src/main/python/setup.py", line 16, in <module>

from setuptools import setup

ImportError: No module named setuptools

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] Ambari Server ..................................... SUCCESS [4:21:03.664s]

[INFO] Ambari Agent ...................................... FAILURE [13.439s]

[INFO] Ambari Client ..................................... SKIPPED

[INFO] Ambari Python Client .............................. SKIPPED

[INFO] Ambari Groovy Client .............................. SKIPPED

[INFO] Ambari Shell ...................................... SKIPPED

[INFO] Ambari Python Shell ............................... SKIPPED

[INFO] Ambari Groovy Shell ............................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 4:21:19.470s

[INFO] Finished at: Wed Feb 17 10:00:12 PST 2016

[INFO] Final Memory: 56M/239M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (python-package) on project ambari-agent: Command execution failed. Process exited with an error: 1(Exit value: 1) -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :ambari-agent

解决办法:可能是网络错误,重新编译就过了

错误7: Could not find artifact org.codehaus.groovy:groovy-all:jar:2.1.8 --- maven有些包下载不下来,需手动下载

[INFO] ------------------------------------------------------------------------

[INFO] Building Ambari Groovy Client 1.7.0.0

[INFO] ------------------------------------------------------------------------

Downloading: http://download.java.net/maven/2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom

Downloading: http://download.java.net/maven/glassfish/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom

Downloading: https://maven.atlassian.com/repository/public/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom

Downloaded: https://maven.atlassian.com/repository/public/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom (10 KB at 0.8 KB/sec)

Downloading: http://download.java.net/maven/2/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom

Downloading: http://download.java.net/maven/glassfish/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom

Downloading: https://maven.atlassian.com/repository/public/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom

Downloaded: https://maven.atlassian.com/repository/public/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom (11 KB at 1.9 KB/sec)

Downloading: http://download.java.net/maven/2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar

Downloading: http://download.java.net/maven/glassfish/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar

Downloading: https://maven.atlassian.com/repository/public/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar

Downloaded: https://maven.atlassian.com/repository/public/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar (42 KB at 14.9 KB/sec)

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.pom

Downloading: http://repo.spring.io/milestone/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.pom

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.pom

[WARNING] The POM for org.slf4j:slf4j-api:jar:1.7.2 is missing, no dependency information available

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/slf4j/slf4j-log4j12/1.7.2/slf4j-log4j12-1.7.2.pom

Downloading: http://repo.spring.io/milestone/org/slf4j/slf4j-log4j12/1.7.2/slf4j-log4j12-1.7.2.pom

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/slf4j/slf4j-log4j12/1.7.2/slf4j-log4j12-1.7.2.pom

[WARNING] The POM for org.slf4j:slf4j-log4j12:jar:1.7.2 is missing, no dependency information available

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/codehaus/groovy/groovy-all/2.1.8/groovy-all-2.1.8.pom

Downloading: http://repo.spring.io/milestone/org/codehaus/groovy/groovy-all/2.1.8/groovy-all-2.1.8.pom

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/groovy/groovy-all/2.1.8/groovy-all-2.1.8.pom

[WARNING] The POM for org.codehaus.groovy:groovy-all:jar:2.1.8 is missing, no dependency information available

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom

Downloading: http://repo.spring.io/milestone/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom

[WARNING] The POM for org.codehaus.groovy.modules.http-builder:http-builder:jar:0.7.1 is missing, no dependency information available

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/easymock/easymock/3.2/easymock-3.2.pom

Downloading: http://repo.spring.io/milestone/org/easymock/easymock/3.2/easymock-3.2.pom

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/easymock/easymock/3.2/easymock-3.2.pom

[WARNING] The POM for org.easymock:easymock:jar:3.2 is missing, no dependency information available

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.pom

Downloading: http://repo.spring.io/milestone/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.pom

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.pom

[WARNING] The POM for org.spockframework:spock-core:jar:0.7-groovy-2.0 is missing, no dependency information available

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/commons-io/commons-io/2.1/commons-io-2.1.pom

Downloading: http://repo.spring.io/milestone/commons-io/commons-io/2.1/commons-io-2.1.pom

Downloading: http://repository.jboss.org/nexus/content/groups/public/commons-io/commons-io/2.1/commons-io-2.1.pom

[WARNING] The POM for commons-io:commons-io:jar:2.1 is missing, no dependency information available

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.jar

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/easymock/easymock/3.2/easymock-3.2.jar

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/codehaus/groovy/groovy-all/2.1.8/groovy-all-2.1.8.jar

Downloading: http://download.eclipse.org/rt/eclipselink/maven.repo/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.jar

Downloading: http://repo.spring.io/milestone/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.jar

Downloading: http://repo.spring.io/milestone/org/easymock/easymock/3.2/easymock-3.2.jar

Downloading: http://repo.spring.io/milestone/org/codehaus/groovy/groovy-all/2.1.8/groovy-all-2.1.8.jar

Downloading: http://repo.spring.io/milestone/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.jar

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/groovy/groovy-all/2.1.8/groovy-all-2.1.8.jar

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.jar

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/easymock/easymock/3.2/easymock-3.2.jar

Downloading: http://repository.jboss.org/nexus/content/groups/public/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.jar

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] Ambari Agent ...................................... SUCCESS [33.185s]

[INFO] Ambari Client ..................................... SUCCESS [2.384s]

[INFO] Ambari Python Client .............................. SUCCESS [3.655s]

[INFO] Ambari Groovy Client .............................. FAILURE [1:10.271s]

[INFO] Ambari Shell ...................................... SKIPPED

[INFO] Ambari Python Shell ............................... SKIPPED

[INFO] Ambari Groovy Shell ............................... SKIPPED

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1:52.395s

[INFO] Finished at: Thu Feb 18 05:31:14 PST 2016

[INFO] Final Memory: 16M/40M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project groovy-client: Could not resolve dependencies for project org.apache.ambari:groovy-client:jar:1.7.0.0: The following artifacts could not be resolved: org.codehaus.groovy:groovy-all:jar:2.1.8, org.codehaus.groovy.modules.http-builder:http-builder:jar:0.7.1, org.easymock:easymock:jar:3.2, org.spockframework:spock-core:jar:0.7-groovy-2.0: Could not find artifact org.codehaus.groovy:groovy-all:jar:2.1.8 in EclipseLink (http://download.eclipse.org/rt/eclipselink/maven.repo) -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :groovy-client

解决办法:

从这个网站找到相应包,手动下载

http://mvnrepository.com/artifact/org.easymock/easymock/3.2

cd /root/.m2/repository/org/codehaus/groovy/groovy-all/2.1.8

rm groovy-all-2.1.8.* -f

wget http://central.maven.org/maven2/org/codehaus/groovy/groovy-all/2.1.8/groovy-all-2.1.8.jar

类似的还有其他几个包,也做相同的处理,手动下载:

cd /root/.m2/repository/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1

rm http-builder-0.7.1.jar* -f

wget http://central.maven.org/maven2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.jar

cd /root/.m2/repository/org/easymock/easymock/3.2

rm -f *.jar*

wget http://central.maven.org/maven2/org/easymock/easymock/3.2/easymock-3.2.jar

cd /root/.m2/repository/org/spockframework/spock-core/0.7-groovy-2.0

rm -f *.jar*

wget http://central.maven.org/maven2/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.jar

时间: 2024-12-19 14:24:19

Ambari 1.7 源码编译笔记的相关文章

【Python笔记】如何源码编译依赖LAPACK和ATLAS库的NumPy包

上篇笔记介绍了不依赖lapack和atlas库的NumPy包源码编译/安装方法,但"纯净版"的NumPy会损失性能,故本篇笔记说明如何源码编译安装依赖lapack和atlas库的NumPy包. 1. GCC版本要求 使用较新版本的GCC工具集(尽量不低于v4.7)且集成有gfortran编译器. 备注1:这里大写的"GCC"是指GNU Compiler Collection,它除包含C语言编译器gcc外,还包含很多其它语言的编译器(如g++/gfortran等) 备

马哥linux学习笔记:源码编译安装

由于rpm包在作者制作封装的时候已经把程序的一些特性固定了,如果我们根据自己的需求,需要运用程序的一些没有普适性相关特性,就需要下载程序的源码手动编译安装了,这里只是简单的介绍一下C代码的程序包编译安装方法. 为了能更直观的看到源码编译安装的过程,我演示一下在centos7.2环境中编译安装httpd2.2: 首先,编译的前提是得有称手的工具及环境了,编译c源代码就需要用到开发工具,make,gcc了,环境就需要开发库跟头文件了,如果系统中没有这些,就需要yum安装了. 这里我运行yum gro

学习OpenCV的学习笔记系列(二)源码编译及自带样例工程

下载及安装CMake3.0.1 要自己编译OpenCV2.4.9的源码,首先,必须下载编译工具,使用的比较多的编译工具是CMake. 下面摘录一段关于CMake的介绍: CMake是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程).他能够输出各种各样的makefile或者project文件,能测试编译器所支持的C 特性,类似UNIX下的automake.只是 CMake 的组态档取名为 CmakeLists.txt.Cmake 并不直接建构出最终的软件,而是产生标准

linux学习笔记——源码编译安装Mysql

#######Redhat6.5源码编译安装Mysql########实验环境:1.IP:172.25.8.32.磁盘要大于20G先添加一块大于20G的磁盘fdisk /dev/vdb        ##得到/dev/vdb1 8e linuxpvcreate /dev/vdb1    ##把物理分区做成物理卷vgextend vg_server1 /dev/vdb1    ##把新建立的/dev/vdb1添加到vg_server1中lvextend -L 20G /dev/vg_server1

linux学习笔记——源码编译安装PHP

#######Redhat6.5源码编译安装php########实验环境:IP:172.25.8.3(已经安装了nginx.mysql服务并能正常使用) 实验内容:1.安装包php-5.6.20.tar.bz2re2c-0.13.5-1.el6.x86_64.rpm   ##PHP的词法解释器re2clibmcrypt-2.5.8-9.el6.x86_64.rpm   ##提供mcrypt,mcrypt是php中重要的加密支持扩展库libmcrypt-devel-2.5.8-9.el6.x86

源码编译绕过反调试

参考师弟的贴子修改的, 基本我一次就弄好了, 没有遇到啥问题, 下面我主要是补充下他的帖子 http://bbs.pediy.com/showthread.php?t=213481 一. 环境搭建 (1). 环境介绍: 手机:nexus 5 ubuntu版本:15.10 android版本:4.4.4 android源码官网(这里有很多相关的资料,基本上按照官网的来就可以编译想编译的任何版本了) http://source.android.com/source/ (2). 环境配置 配置环境得好

Python源码剖析笔记3-Python执行原理初探

Python源码剖析笔记3-Python执行原理初探 本文简书地址:http://www.jianshu.com/p/03af86845c95 之前写了几篇源码剖析笔记,然而慢慢觉得没有从一个宏观的角度理解python执行原理的话,从底向上分析未免太容易让人疑惑,不如先从宏观上对python执行原理有了一个基本了解,再慢慢探究细节,这样也许会好很多.这也是最近这么久没有更新了笔记了,一直在看源码剖析书籍和源码,希望能够从一个宏观层面理清python执行原理.人说读书从薄读厚,再从厚读薄方是理解了

Python源码剖析笔记0 ——C语言基础

python源码剖析笔记0--C语言基础回顾 要分析python源码,C语言的基础不能少,特别是指针和结构体等知识.这篇文章先回顾C语言基础,方便后续代码的阅读. 1 关于ELF文件 linux中的C编译得到的目标文件和可执行文件都是ELF格式的,可执行文件中以segment来划分,目标文件中,我们是以section划分.一个segment包含一个或多个section,通过readelf命令可以看到完整的section和segment信息.看一个栗子: char pear[40]; static

Python源码剖析笔记4-内建数据类型

Python源码剖析笔记4-内建数据类型 Python内建数据类型包括整数对象PyIntObject,字符串对象PyStringObject,列表对象PyListObject以及字典对象PyDictObject等.整数对象之前已经分析过了,这一篇文章准备分析下余下几个对象,这次在<python源码剖析>中已经写的很详细的部分就不赘述了,主要是总结一些之前看书时疑惑的地方. 1 整数对象-PyIntObject 参见 python整数对象. 2 字符串对象-PyStringObject 2.1