Ubuntu 14.04下Red5源码编译

编译环境:Ubuntu14.04/JDK7

步骤:

1、svn检出源码(两种方式)

svn co --depth empty https://github.com/Red5/red5-server (最新版)

svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5-read-only(我使用的是这个1.0.2-RC4版)

2、编译,跳过test

mvn -Dmaven.test.skip=true install

编译结果如下:

[INFO] Installing /home/linuxidc/wmw/red5-google/red5-read-only/target/red5-server-1.0.2-RC4-sources.jar to /home/linuxidc/.m2/repository/org/red5/red5-server/1.0.2-RC4/red5-server-1.0.2-RC4-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:21.353s
[INFO] Finished at: Wed Oct 15 09:34:22 CST 2014
[INFO] Final Memory: 16M/40M
[INFO] ------------------------------------------------------------------------

进去看看都有什么:

red5-server-1.0.2-RC4-server.tar.gz 这个就是我们编译后的red5-server了,先解压看一下:

运行red5.sh

[INFO] [Launcher:/installer] org.red5.server.Context - Setting parent bean factory as core
[INFO] [Launcher:/installer] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:live] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:vod] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:/] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:/installer] org.red5.server.Server - Add mapping global: default host: localhost context: installer
[INFO] [Launcher:live] org.red5.server.Server - Add mapping global: default host:  context: live
[INFO] [Launcher:vod] org.red5.server.Server - Add mapping global: default host:  context: vod
[INFO] [Launcher:/] org.red5.server.Server - Add mapping global: default host:  context:
[WARN] [Launcher:/] org.red5.server.scope.Scope - Invalid scope rejected: Scope [name=, path=/default, type=APPLICATION, autoStart=true, creationTime=1413342261664, depth=1, enabled=true, running=false]
[WARN] [Launcher:/] org.red5.server.scope.Scope - Scope not added to parent
[INFO] [Launcher:/installer] org.red5.server.Server - Add mapping global: default host: localhost:5080 context: installer
[INFO] [Launcher:/installer] org.red5.server.service.Installer - Installer service created

3、下载拷贝依赖关系

这时候target下会多出一个文件夹 dependency

[INFO] Scanning for projects...
[INFO]                                                                       
[INFO] ------------------------------------------------------------------------
[INFO] Building Red5 :: Server 1.0.2-RC4
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (default-cli) @ red5-server ---
[INFO] Copying httpclient-4.2.1.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependencytpclient-4.2.1.jar
[INFO] Copying commons-beanutils-1.8.3.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependency/commons-beanutils-1.8.3.jar
[INFO] Copying spring-beans-3.1.4.RELEASE.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependency/spring-beans-3.1.4.RELEASE.jar
[INFO] Copying bcprov-jdk15on-1.47.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependency/bcprov-jdk15on-1.47.jar
.....................................
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.703s
[INFO] Finished at: Wed Oct 15 09:36:59 CST 2014
[INFO] Final Memory: 9M/22M
[INFO] ------------------------------------------------------------------------

4、打包所有的package,跳过test

mvn -Dmaven.test.skip=true -Dmaven.buildNumber.doUpdate=false package

此时重新生成新的可运行的red5-server-1.0.2-RC4-server.tar.gz

...................................................................................................................[INFO] Building jar: /home/linuxidc/wmw/red5-google/red5-read-only/target/red5-server-1.0.2-RC4-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.994s
[INFO] Finished at: Wed Oct 15 10:01:19 CST 2014
[INFO] Final Memory: 14M/35M
[INFO] ------------------------------------------------------------------------

解压出来新的red5-server-1.0.2-RC4-server.tar.gz,与之前编译的进行一次比较,如下图,主要区别是生成了新的lib库文件:

Ubuntu 14.04下Red5源码编译

5、运行red.sh

[WARN] [Launcher:/] org.red5.server.scope.Scope - Invalid scope rejected: Scope [name=, path=/default, type=APPLICATION, autoStart=true, creationTime=1413341225677, depth=1, enabled=true, running=false]
[WARN] [Launcher:/] org.red5.server.scope.Scope - Scope not added to parent
[INFO] [Launcher:/installer] org.red5.server.service.Installer - Installer service created

ok,finished

Ubuntu 14.04下Red5源码编译

相关推荐