<?xml version="1.0"?> <project name="defonds-live-module" default="jar" basedir=".."> <property name="wowza.lib.dir" value="d:/tools/Wowza Media Systems/Wowza Streaming Engine 4.0.1/lib"/> <property name="jar.filename" value="defonds-live-module.jar"/> <property name="core.build.dir" value="bin"/> <target name="jar"> <jar jarfile="${wowza.lib.dir}/${jar.filename}"> <fileset dir="${core.build.dir}"/> </jar> </target> </project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>WowzaWithMavenIntegration</groupId> <artifactId>defonds-server-module</artifactId> <version>1.0.0</version> <packaging>jar</packaging> <name>defonds-server-module</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <wms.version>4.0.1</wms.version> <libFolderName>dep-libs</libFolderName> <spring.version>3.1.2.RELEASE</spring.version> <httpcomponents.version>4.2.1</httpcomponents.version> <javamail.version>1.4.5</javamail.version> <commons.email.version>1.1</commons.email.version> <commons.exec.version>1.1</commons.exec.version> <commons.beanutils.version>1.8.3</commons.beanutils.version> <commons.codec.version>1.6</commons.codec.version> <commons.collections.version>3.2.1</commons.collections.version> <commons.lang.version>2.6</commons.lang.version> <commons.io.version>2.4</commons.io.version> <commons.pool.version>1.6</commons.pool.version> <commons.dbcp.version>1.4</commons.dbcp.version> <log4j.version>1.2.16</log4j.version> <slf4j.version>1.6.6</slf4j.version> <jackson.version>1.9.2</jackson.version> </properties> <dependencies> <!-- wms dependence jar --> <dependency> <groupId>com.wms</groupId> <artifactId>wms-server</artifactId> <version>${wms.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.wms</groupId> <artifactId>wms-stream-publish</artifactId> <version>${wms.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.wms</groupId> <artifactId>wms-httpstreamer-smoothstreaming</artifactId> <version>${wms.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.wms</groupId> <artifactId>wms-httpstreamer-cupertinostreaming</artifactId> <version>${wms.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.wms</groupId> <artifactId>wms-httpstreamer-directstreaming</artifactId> <version>${wms.version}</version> <scope>provided</scope> </dependency> <!-- not wms dependence jar --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>${commons.lang.version}</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>${commons.beanutils.version}</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>${commons.codec.version}</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>${commons.collections.version}</version> </dependency> <dependency> <groupId>commons-pool</groupId> <artifactId>commons-pool</artifactId> <version>${commons.pool.version}</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>${commons.dbcp.version}</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>org.apache.ibatis</groupId> <artifactId>ibatis-sqlmap</artifactId> <version>2.3.4.726</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.19</version> </dependency> <!-- logs --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency> </dependencies> <build> <plugins> <!-- lets force java 1.6 version for this project --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.2</version> <executions> <execution> <id>copy-dependencies</id> <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <includeScope>runtime</includeScope> <outputDirectory>${project.build.directory}/${libFolderName}</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> </configuration> </execution> </executions> </plugin> <!-- build jar and add main class delaration to metafile --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.1</version> <configuration> <finalName>${project.artifactId}</finalName> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>${libFolderName}/</classpathPrefix> </manifest> <manifestEntries> </manifestEntries> <addMavenDescriptor>false</addMavenDescriptor> </archive> </configuration> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>package</phase> <configuration> <tasks> <copy file="${project.build.directory}/${project.artifactId}.jar" tofile="${env.WMSINSTALL_HOME}/lib/${project.artifactId}.jar" overwrite="true" /> <copy todir="${env.WMSINSTALL_HOME}/lib/${libFolderName}" overwrite="true"> <fileset dir="${project.build.directory}/${libFolderName}" includes="**" /> </copy> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> <!-- lets execute our project exec:java goal --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2</version> <configuration> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <version>2.3.1</version> <executions> <execution> <id>Install Wmsserver</id> <phase>validate</phase> <goals> <goal>install-file</goal> </goals> <configuration> <packaging>jar</packaging> <groupId>com.wms</groupId> <artifactId>wms-server</artifactId> <version>${wms.version}</version> <file>${basedir}/lib/wms-server.jar</file> </configuration> </execution> <execution> <id>Install Wmsserver stream-publish library</id> <phase>validate</phase> <goals> <goal>install-file</goal> </goals> <configuration> <packaging>jar</packaging> <groupId>com.wms</groupId> <artifactId>wms-stream-publish</artifactId> <version>${wms.version}</version> <file>${basedir}/lib/wms-stream-publish.jar</file> </configuration> </execution> <execution> <id>Install Wmsserver wms-httpstreamer-smoothstreaming library</id> <phase>validate</phase> <goals> <goal>install-file</goal> </goals> <configuration> <packaging>jar</packaging> <groupId>com.wms</groupId> <artifactId>wms-httpstreamer-smoothstreaming</artifactId> <version>${wms.version}</version> <file>${basedir}/lib/wms-httpstreamer-smoothstreaming.jar</file> </configuration> </execution> <execution> <id>Install Wmsserver wms-httpstreamer-cupertinostreaming library</id> <phase>validate</phase> <goals> <goal>install-file</goal> </goals> <configuration> <packaging>jar</packaging> <groupId>com.wms</groupId> <artifactId>wms-httpstreamer-cupertinostreaming</artifactId> <version>${wms.version}</version> <file>${basedir}/lib/wms-httpstreamer-cupertinostreaming.jar</file> </configuration> </execution> <execution> <id>Install Wmsserver wms-httpstreamer-directstreaming library</id> <phase>validate</phase> <goals> <goal>install-file</goal> </goals> <configuration> <packaging>jar</packaging> <groupId>com.wms</groupId> <artifactId>wms-httpstreamer-directstreaming</artifactId> <version>${wms.version}</version> <file>${basedir}/lib/wms-httpstreamer-directstreaming.jar</file> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
<ServerListener> <BaseClass>com.defonds.wms.module.server.DefondsWowzaServerListener</BaseClass> </ServerListener>
-Xmx768M -Dcom.wowza.wms.AppHome="d:/tools/Wowza Media Systems/Wowza Streaming Engine 4.0.1" -Dcom.wowza.wms.ConfigHome="d:/tools/Wowza Media Systems/Wowza Streaming Engine 4.0.1" -Dcom.sun.management.jmxremote=true -Dcom.wowza.wms.native.base="win"
在 TestServiceImpl 中加个断点,然后 debug 启动上一步建好的 defonds-server-module,断点效果图如下:
看上去是不是很 perfect?就此开始你的 Wowza 插件开发之旅吧,Maven supported 哦!
写在最后的话