-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathpom.xml
More file actions
100 lines (93 loc) · 3.86 KB
/
pom.xml
File metadata and controls
100 lines (93 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0" encoding="UTF-8"?>
<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>org.example</groupId>
<artifactId>test_jiajiaocr</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- Maven 依赖(自动打包进 JAR) -->
<dependency>
<groupId>com.microsoft.onnxruntime</groupId>
<artifactId>onnxruntime</artifactId>
<version>1.19.0</version>
</dependency>
<dependency>
<groupId>ai.djl.mxnet</groupId>
<artifactId>mxnet-engine</artifactId>
<version>0.31.0</version>
</dependency>
<dependency>
<groupId>ai.djl.opencv</groupId>
<artifactId>opencv</artifactId>
<version>0.31.0</version>
</dependency>
<dependency>
<groupId>ai.djl</groupId>
<artifactId>api</artifactId>
<version>0.31.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.17.0</version>
</dependency>
<!-- 关键:编译时依赖 JiaJiaOCR.jar(system 范围,仅用于编译) -->
<dependency>
<groupId>com.jiajia</groupId>
<artifactId>JiaJiaOCR</artifactId>
<version>1.0</version>
<scope>system</scope>
<!-- 本地 JAR 路径:必须存在,否则编译失败 -->
<systemPath>${project.basedir}/lib/JiaJiaOCR.jar</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 编译插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- Shade 插件:打包 Maven 依赖,但排除 JiaJiaOCR.jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<!-- 关键:排除 JiaJiaOCR.jar(不打包进最终 JAR) -->
<excludes>
<exclude>com.jiajiaocr:JiaJiaOCR</exclude>
</excludes>
</artifactSet>
<transformers>
<!-- 指定主类 -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>JaJaOCR</mainClass> <!-- 替换为你的主类 -->
</transformer>
</transformers>
<finalName>test-jiajiaocr</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>