-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
181 lines (161 loc) · 7 KB
/
Copy pathpom.xml
File metadata and controls
181 lines (161 loc) · 7 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?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>io.github.oneocr</groupId>
<artifactId>oneocr-cli</artifactId>
<version>2.0</version>
<properties>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Depend on the API module -->
<dependency>
<groupId>io.github.oneocr</groupId>
<artifactId>oneocr-api</artifactId>
<version>2.0</version>
</dependency>
<!-- Optional Tesseract second pass for Indic scripts OneOCR cannot read -->
<dependency>
<groupId>io.github.oneocr</groupId>
<artifactId>oneocr-tesseract</artifactId>
<version>2.0</version>
</dependency>
<!-- Pico CLI for command line interface -->
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.5</version>
</dependency>
<!-- org.json for simple JSON handling -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20240303</version>
</dependency>
<dependency>
<groupId>io.github.luvml</groupId>
<artifactId>luvml</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.17.2</version>
</dependency>
<!-- WebP ImageIO support with write capability -->
<dependency>
<groupId>io.github.darkxanter</groupId>
<artifactId>webp-imageio</artifactId>
<version>0.3.0</version>
</dependency>
<!-- JPEG2000 ImageIO support for PDFBox -->
<dependency>
<groupId>com.github.jai-imageio</groupId>
<artifactId>jai-imageio-jpeg2000</artifactId>
<version>1.4.0</version>
</dependency>
<!-- JAI ImageIO Core (TIFF and other formats) -->
<dependency>
<groupId>com.github.jai-imageio</groupId>
<artifactId>jai-imageio-core</artifactId>
<version>1.4.0</version>
</dependency>
<!-- JBIG2 ImageIO plugin for monochrome/bi-level images -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>jbig2-imageio</artifactId>
<version>3.0.4</version>
</dependency>
<!-- JLine for cross-platform terminal/console support -->
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal</artifactId>
<version>3.24.1</version>
</dependency>
<!-- Lombok for reducing boilerplate -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
<scope>provided</scope>
</dependency>
<!-- Windows Console Unicode Output -->
<dependency>
<groupId>io.github.xyz-jphil</groupId>
<artifactId>xyz-jphil-windows_console_set_unicode_output</artifactId>
<version>1.0</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- The command this jar installs is 1ocr, so the jar is named for the command, not the artifact -->
<finalName>1ocr-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>22</source>
<target>22</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<argLine>--enable-native-access=ALL-UNNAMED,oneocr.api,xyz.jphil.windows_console_set_unicode_output</argLine>
</configuration>
</plugin>
<!-- Build executable JAR with dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>oneocr.cli.OcrTool</mainClass>
</transformer>
<!-- CRITICAL: Merge ImageIO service provider files (META-INF/services/*) for JPEG2000 support.
Without this, jai-imageio-jpeg2000 plugin won't be discovered at runtime in shaded JAR,
causing "Cannot read JPEG2000 image: Java Advanced Imaging (JAI) Image I/O Tools are not installed" errors.
The dependency alone isn't enough - service discovery metadata must be merged. -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>