Browse Source

调整 pom,增加 profile

zhzhenqin 7 months ago
parent
commit
f215ba02fc
3 changed files with 82 additions and 41 deletions
  1. 1 0
      .gitignore
  2. 80 40
      pom.xml
  3. 1 1
      src/main/resources/application.properties

+ 1 - 0
.gitignore

@@ -31,3 +31,4 @@ build/
 
 ### VS Code ###
 .vscode/
+install

+ 80 - 40
pom.xml

@@ -17,6 +17,12 @@
 
 	<properties>
 		<java.version>1.8</java.version>
+
+		<opencv.version>4.7.0-0</opencv.version>
+		<onnx.version>1.16.3</onnx.version>
+		<cpu.arch>macosx-x86_64</cpu.arch>
+
+		<java.main.class>com.zj.EasyMediaApplication</java.main.class>
 	</properties>
 
 	<dependencies>
@@ -48,22 +54,39 @@
 		</dependency>
 
 		<!-- 全量引入 ,包含javacv、ffmpeg、opencv等 -->
-		<!-- <dependency> <groupId>org.bytedeco</groupId> <artifactId>javacv-platform</artifactId> 
-			<version>1.5.6</version> </dependency> -->
+		<dependency>
+		  <groupId>org.bytedeco</groupId> 
+		  <artifactId>javacv-platform</artifactId> 
+			<version>1.5.6</version> 
+		</dependency> 
 
 		<!-- 媒体只用到以下两个,javacv、ffmpeg -->
+		<!--视频流处理-->
 		<dependency>
 			<groupId>org.bytedeco</groupId>
 			<artifactId>javacv</artifactId>
-			<version>1.5.6</version>
+			<version>1.5.9</version>
+		</dependency>
+		<dependency>
+			<groupId>org.bytedeco</groupId>
+			<artifactId>opencv</artifactId>
+			<version>4.7.0-1.5.9</version>
+			<classifier>${cpu.arch}</classifier>
 		</dependency>
-		
-		<!-- ffmpeg全平台引入 -->
-		<!-- <dependency>
+		<dependency>
 			<groupId>org.bytedeco</groupId>
-			<artifactId>ffmpeg-platform</artifactId>
-			<version>4.4-1.5.6</version>
-		</dependency> -->
+			<artifactId>ffmpeg</artifactId>
+			<version>6.0-1.5.9</version>
+			<classifier>${cpu.arch}</classifier>
+		</dependency>
+		<dependency>
+			<groupId>org.openpnp</groupId>
+			<artifactId>opencv</artifactId>
+			<version>${opencv.version}</version>
+		</dependency>
+
+		<!--
+
 		<dependency>
 			<groupId>org.bytedeco</groupId>
 			<artifactId>ffmpeg</artifactId>
@@ -76,6 +99,7 @@
 			<version>4.4-1.5.6</version>
 			<classifier>linux-x86_64</classifier>
 		</dependency>
+		 -->
 
 		<!-- 工具包 -->
 		<dependency>
@@ -138,38 +162,54 @@
 					<includeSystemScope>true</includeSystemScope>
 				</configuration>
 			</plugin>
+
+      <plugin>
+      	<groupId>org.codehaus.mojo</groupId>
+      	<artifactId>exec-maven-plugin</artifactId>
+      	<version>1.6.0</version>
+      	<configuration>
+      		<mainClass>${java.main.class}</mainClass>
+      		<arguments>
+      		</arguments>
+      		<!--
+          <executable>java</executable>
+          <arguments>
+              <argument>-Xmx64m</argument>
+              <argument>-classpath</argument>
+              <classpath />
+              <argument>${java.main.class}</argument>
+          </arguments>
+          -->
+      	</configuration>
+      	<executions>
+      		<execution>
+      			<goals>
+      				<goal>java</goal>
+      			</goals>
+      		</execution>
+      	</executions>
+      </plugin>
 		</plugins>
 	</build>
 
-	<!-- 为了加速下载需要在 pom 文件中复制如下信息 -->
-	<repositories>
-		<repository>
-			<id>aliyun</id>
-			<name>Nexus Snapshot Repository</name>
-			<url>https://maven.aliyun.com/repository/public</url>
-			<layout>default</layout>
-			<releases>
-				<enabled>true</enabled>
-			</releases>
-			<!-- snapshots默认是关闭的,需要开启  -->
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</repository>
-	</repositories>
-	<pluginRepositories>
-		<pluginRepository>
-			<id>aliyun</id>
-			<name>Nexus Snapshot Repository</name>
-			<url>https://maven.aliyun.com/repository/public</url>
-			<layout>default</layout>
-			<releases>
-				<enabled>true</enabled>
-			</releases>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</pluginRepository>
-	</pluginRepositories>
-
+  <profiles>
+	<profile>
+		<id>linux_x64</id>
+		<properties>
+			<cpu.arch>linux-x86_64</cpu.arch>
+		</properties>
+	</profile>
+	<profile>
+		<id>mac_intel_x64</id>
+		<properties>
+			<cpu.arch>macosx-x86_64</cpu.arch>
+		</properties>
+	</profile>
+	<profile>
+		<id>win_intel_x64</id>
+		<properties>
+			<cpu.arch>windows-x86_64</cpu.arch>
+		</properties>
+	</profile>
+</profiles>
 </project>

+ 1 - 1
src/main/resources/application.properties

@@ -13,7 +13,7 @@ mediaserver.autoClose=true
 #无人拉流观看持续多久自动关闭,1分钟
 mediaserver.autoClose.noClientsDuration=60000
 #保存录像切片目录
-#mediaserver.path = d:/flv/ts
+mediaserver.path=/Volumes/Media/WorkDoc/Beizhi/CODE/EasyMedia/install/ts
 #修改代码是否自动重启
 spring.devtools.restart.enabled=false
 #使用prod配置