操作系统:Linux x64 / Ubuntu 14.04
研究领域:软件定义网络SDN (Software-defined Networking)
开发组件:OpenDaylight
一、环境搭建
1. Java+Apache Maven基本开发环境搭建。详见相应的前面两篇文档:
《Ubuntu Linux系统下Apache Maven的安装和配置》
2. 安装用来获取OpenDaylight源码的Git工具。
sudo apt-get install git-core
3. 针对Opendaylight,安装好Maven后,需要编辑一个非常重要的文件 settings.xml。直接修改该文件,就能在机器上全局地定制 Maven的行为。~/.m2是默认的maven本地仓库。刚装好maven的后~/.m2下是没有settings.xml的文件的。在/etc/maven下有settings.xml的原型,一般情况下,我们更偏向于复制该文件至home目录下的.m2/目录下(这里~表示用户目录),然后修改该文件,在用户范围定制 Maven的行为。前者又被叫做全局配置,后者被称为用户配置。如果两者都存在,它们的内容将被合并,并且用户范围的settings.xml优先。在这里要在~/目录下创建.m2文件夹,然后执行修改命令(详见官网:https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup):
sudo mkdir .m2
sudo cp -n ~/.m2/settings.xml{,.orig} ; \wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
完成后输入“sudo gedit /.m2/settings.xml”查看settings.xml内容,应该显示如下:
# Shortcut command for grabbing settings.xml
cp -n ~/.m2/settings.xml{,.orig} ; \
wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 ">
<profiles>
<profile>
<id>opendaylight-release</id>
<repositories>
<repository>
<id>opendaylight-mirror</id>
<name>opendaylight-mirror</name>
<url></url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>opendaylight-mirror</id>
<name>opendaylight-mirror</name>
<url></url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>opendaylight-snapshots</id>
<repositories>
<repository>
<id>opendaylight-snapshot</id>
<name>opendaylight-snapshot</name>
<url></url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>opendaylight-snapshot</id>
<name>opendaylight-snapshot</name>
<url></url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>