Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Setting the version via Maven has changed

...

  • xCode (if using Mac - free download from the apple store)
  • JDK 7 8 (Ambari 2.0 6 and below can be compiled with JDK 67, from Ambari 32.07, it can be compiled with at least JDK 8)
  • Apache Maven 3.3.9 or later
    Tip: In order to persist your changes to the JAVA_HOME environment variable and add Maven to your path, create the following files:
    File: ~/.profile

     

    Code Block
    source ~/.bashrc

     

    File: ~/.bashrc

     

    Code Block
    export PATH=/usr/local/apache-maven-3.3.9/bin:$PATH
    export JAVA_HOME=$(/usr/libexec/java_home)
    export _JAVA_OPTIONS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"


  • Python 2.6 Python setuptools - python (Ambari 2.6: Download or python 7 or later require Python 2.7 as minimum supported version)
  • Python setuptools:
    for Python : Download and run:
    2.6: Download setuptools and run:

    Code Block
    sh setuptools-0.6c11-py2.6.egg

    for Python 2.7:  Download setuptools and run:

    Code Block
    sh setuptools-0.6c11-py2.7.egg


  • rpmbuild (rpm-build package)
  • g++ (gcc-c++ package)

...

 

[ERROR] Failed to execute goal on project ambari-metrics-kafka-sink: Could not resolve dependencies for project org.apache.ambari:ambari-metrics-kafka-sink:jar:2.0.0-0: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Could not transfer artifact javax.jms:jms:jar:1.1 from/to java.net (https://maven-repository.dev.java.net/nonav/repository): No connector available to access repository java.net (https://maven-repository.dev.java.net/nonav/repository) of type legacy using the available factories WagonRepositoryConnectorFactory

 

The work around is to manually install the three missing artifacts:

 

mvn install:install-file -Dfile=jms-1.1.pom -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar
mvn install:install-file -Dfile=jmxtools-1.2.1.pom -DgroupId=com.sun.jdmk -DartifactId=jmxtools -Dversion=1.2.1 -Dpackaging=jar
mvn install:install-file -Dfile=jmxri-1.2.1.pom -DgroupId=com.sun.jmx -DartifactId=jmxri -Dversion=1.2.1 -Dpackaging=jar


If when compiling it seems stuck, and you've already increased Java and Maven heapsize, it could be that Ambari Views has a lot of artifacts, and the rat-check is choking up. In this case, try running

git clean -df (this will remove untracked files and directories)
mvn clean package -DskipTests -Drat.ignoreErrors=true
or
mvn clean package -DskipTests -Drat.skip


Setting the Version Using Maven

Ambari 2.8+ uses a newer method to update the version when building Ambari. 

Code Block
languagebash
titleRHEL/CentOS 6:
# Update the revision property to the release version
mvn versions:set-property -Dproperty=revision -DnewVersion=2.8.0.0.0 

mvn -B clean install package rpm:rpm -DskipTests -Dpython.ver="python >= 2.6" -Preplaceurl


Code Block
languagebash
titleSUSE/SLES 11
# Update the revision property to the release version
mvn versions:set-property -Dproperty=revision -DnewVersion=2.8.0.0.0 
 
mvn -B clean install package rpm:rpm -DskipTests -Psuse11 -Dpython.ver="python >= 2.6" -Preplaceurl


Code Block
languagebash
titleUbuntu 12:
# Update the revision property to the release version
mvn versions:set-property -Dproperty=revision -DnewVersion=2.8.0.0.0 
 
mvn -B clean install package jdeb:jdeb -DskipTests -Dpython.ver="python >= 2.6" -Preplaceurl

Ambari 2.7 and Earlier Releases (Deprecated)

Code Block
languagebash
titleRHEL/CentOS 6:
collapsetrue
mvn versions:set -DnewVersion=${AMBARI_VERSION}
 
#Note: The ambari-metrics project is not wired up to the main ambari project. However there is a dependency on ambari-metrics-common to build the ambari-server RPM. 
#Hence you also need to set ambari-metrics project version as well.
pushd ambari-metrics
mvn versions:set -DnewVersion=${AMBARI_VERSION}
popd
 
mvn -B clean install package rpm:rpm -DskipTests -Dpython.ver="python >= 2.6" -Preplaceurl


Code Block
languagebash
titleSUSE/SLES 11

...

code
collapse
true
mvn versions:set -DnewVersion=${AMBARI_VERSION}
 
#Note: The ambari-metrics project is not wired up to the main ambari project. However there is a dependency on ambari-metrics-common to build the ambari-server RPM. 
#Hence you also need to set ambari-metrics project version as well.
pushd ambari-metrics
mvn versions:set -DnewVersion=${AMBARI_VERSION}
popd
 
mvn -B clean install package rpm:rpm -DskipTests -Psuse11 -Dpython.ver="python >= 2.6" -Preplaceurl


code
Code Block
languagebash
titleUbuntu 12:
collapse
true
mvn versions:set -DnewVersion=${AMBARI_VERSION}
 
#Note: The ambari-metrics project is not wired up to the main ambari project. However there is a dependency on ambari-metrics-common to build the ambari-server RPM. 
#Hence you also need to set ambari-metrics project version as well.
pushd ambari-metrics
mvn versions:set -DnewVersion=${AMBARI_VERSION}
popd
 
mvn -B clean install package jdeb:jdeb -DskipTests -Dpython.ver="python >= 2.6" -Preplaceurl

...