opendaylight 源码编译

来源:互联网 发布:linux cp整个文件夹 编辑:程序博客网 时间:2024/06/05 08:59

首先准备好编译环境:
系统:ubuntu14.04
jdk 1.7.0_79(jdk1.7以上)sudo apt-get install openjdk-7-jdk
maven 3.0以上sudo apt-get install maven
git安装sudo apt-get install git-core
编辑maven的setting.xml文件:**
cp -n ~/.m2/settings.xml{,.orig} ; \
wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
作用是将opendaylight的远程仓库添加进来,没有添加就会出现cannot find artifacts错误;
配置好环境变量:
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_79
export JRE_HOME=JAVA H OME/jreexportCLASSPATH=.: {JAVA_HOME}/lib:JRE H OME/libexportPATH= {JAVA_HOME}/bin:PATHexportM2 H OME=/home/mark/mymaven/apachemavenexportMAVEN O PTS=  Xmx1048mXX:MaxPermSize=512m  exportPATH= PATH:$M2_HOME/bin
1,按照网上的教程获取opendaylight源码
git clone https://git.opendaylight.org/gerrit/p/controller.git
2,准备mvn clean install
这里问题来了: 教程上是说在controller/opendaylight/distribution/opendaylight下进行maven,但是下载的源码却找不到此目录。于是在主目录下/controller进行mvn clean install.可以发现在karaf/target下产生了distribution.opendaylight-karaf-1.5.0-SNAPSHOT.tar.gz
解压缩tar xf distribution.opendaylight-karaf-1.5.0-SNAPSHOT.tar.gz
3,启动opendaylight
1)cd controller/karaf//target/distribution.opendaylight-karaf-1.6.0-SNAPSHOT/bin/
2)./karaf
成功后便可以看到以下图形:
__
_____ \ _ _ _ _____ \ ..| | || _ | |__/ |_
/ | \____ _/ _ \ / \ | | \_ \< | || | | |/ _| | \ \
/ | \ |> > /| | | ` \/ \___ || || / // > Y \ |
_______ / / _ >| /____ (_ / _||_/__ /|_| /|
\/|| \/ \/ \/ \/\/ /_/ \/
Hit ‘’ for a list of available commands
and ‘[cmd] –help’ for help on a specific command.
Hit ‘’ or type ‘system:shutdown’ or ‘logout’ to shutdown OpenDaylight.

1 0
原创粉丝点击