-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathpom.xml
More file actions
478 lines (455 loc) · 17.8 KB
/
Copy pathpom.xml
File metadata and controls
478 lines (455 loc) · 17.8 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
<?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.plm</groupId>
<artifactId>plm</artifactId>
<version>2.9.3-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Programmer's Learning Machine</name>
<description>
Maven build for PLM. Replaces the legacy ant build (build.xml) and its
hand-vendored lib/*.jar binaries. Dependencies are declared here and
fetched from Maven Central; the project is compiled jointly (Java + Scala)
from the existing src/ tree, and `mvn package` produces a self-contained
shaded uber-jar runnable as plm.core.ui.ProgrammersLearningMachine.
</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<scala.version>2.12.20</scala.version>
<scala.compat.version>2.12</scala.compat.version>
<main.class>plm.core.ui.ProgrammersLearningMachine</main.class>
<!-- Tests run by default. The build/jar job skips their EXECUTION with
-DskipTests (the jar does not need the plm.test.* suite); the separate
CI test job runs them under xvfb. -->
<sonar.organization>buggleinc</sonar.organization>
</properties>
<dependencies>
<!-- Scala toolchain. 2.12.x to match the wider scala-dev effort
(upstream pinned 2.11.12). scala-compiler/reflect are needed at
runtime: PLM compiles user Scala exercises in-process. -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala.version}</version>
</dependency>
<!-- Swing editor / layout -->
<dependency>
<groupId>com.fifesoft</groupId>
<artifactId>rsyntaxtextarea</artifactId>
<version>2.5.4</version>
</dependency>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>4.2</version>
</dependency>
<!-- Python exercises: jython-standalone bundles antlr-runtime + asm,
replacing the vendored jython/antlr3-runtime/asm jars. -->
<dependency>
<groupId>org.python</groupId>
<artifactId>jython-standalone</artifactId>
<version>2.7.3</version>
</dependency>
<!-- Ruby exercises: jruby-complete pulls jnr-constants/ffi/posix. -->
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.4.8.0</version>
</dependency>
<!-- Misc runtime libs -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.1-jre</version>
</dependency>
<!-- jline2 API is required by PLM's console; keep the 2.x line. -->
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.14.6</version>
</dependency>
<!-- HTTP stack (feedback dialog / git over https) -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<!-- i18n runtime (the build-time ResourceBundle generator is invoked via
antrun against the vendored gettext-ant-tasks jar; see below). -->
<dependency>
<groupId>com.googlecode.gettext-commons</groupId>
<artifactId>gettext-commons</artifactId>
<version>0.9.8</version>
</dependency>
<!-- JSON: code uses org.json.simple; json-simple 1.1.1 provides it. -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<!-- GitHub issue reporting -->
<dependency>
<groupId>org.eclipse.mylyn.github</groupId>
<artifactId>org.eclipse.egit.github.core</artifactId>
<version>2.1.5</version>
</dependency>
<!-- jgit: THE POINT of this exercise. Was pinned at 3.2.0 (2013); now
a CURRENT 6.x so deprecations surface against the modern API. -->
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>6.10.1.202505221210-r</version>
</dependency>
<!-- SSH transport for jgit. mwiede fork is the maintained JSch. -->
<dependency>
<groupId>com.github.mwiede</groupId>
<artifactId>jsch</artifactId>
<version>0.2.18</version>
</dependency>
<!-- junit/mockito: the test sources (plm.test.*) live under src/ and are
joint-compiled with everything else, so junit/mockito must be on the
COMPILE classpath. Scope=provided keeps them out of the shaded fat jar
(they are not needed at runtime). Surefire is still skipped
(skipTests), so the outdated tests do not run or block the build.
NOTE: the old junit @RunWith(MockitoJUnitRunner) / runners.* API the
tests use was dropped in mockito 5.x; mockito 4.11 retains it. The
tests themselves are outdated (see FINAL NOTES) but at least compile. -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-engine</artifactId>
<version>1.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>4.11.0</version>
<scope>provided</scope>
</dependency>
<!-- AssertJ-Swing drives the actual GUI (MainFrameSmokeTest) under a real or
virtual (xvfb) display. -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-swing-junit</artifactId>
<version>3.17.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.10.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<!-- Resources: mirror what the ant `dist` target jars (build.xml). The
non-.java/.scala files under src/ are exercise templates and Swing
assets that PLM reads at runtime, plus img/, lib/resources, lib/doc,
and ChangeLog. -->
<resources>
<resource>
<directory>src</directory>
<includes>
<include>**/*.py</include>
<include>**/*.c</include>
<include>**/*.js</include>
<include>**/*.scala</include>
<include>**/*.java</include>
<include>**/*.html</include>
<include>**/*.css</include>
<include>**/*.png</include>
<include>**/*.svg</include>
<include>**/*.map</include>
</includes>
</resource>
<resource>
<directory>img</directory>
<targetPath>img</targetPath>
<includes>
<include>**/*.png</include>
<include>**/*.svg</include>
</includes>
</resource>
<resource>
<directory>lib/resources</directory>
<targetPath>resources</targetPath>
</resource>
<resource>
<directory>lib/doc</directory>
<targetPath>doc</targetPath>
<includes>
<include>*.html</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>ChangeLog</include>
</includes>
</resource>
</resources>
<plugins>
<!-- Point compilation at the existing src/ tree (Java + Scala mixed),
without moving any files. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Joint Java+Scala compilation: scalac sees the Java sources and
javac sees the scalac output, so the two languages can
cross-reference each other (Scala lessons extend Java universe
classes; Java loads Scala via reflection). -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.9.2</version>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<arg>-nobootcp</arg>
</args>
<jvmArgs>
<jvmArg>-Xss8m</jvmArg>
</jvmArgs>
</configuration>
<executions>
<execution>
<id>scala-compile</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- javac runs after scalac (joint compilation): the Scala .class
files are on the classpath so Java can reference Scala types. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>${maven.compiler.release}</release>
<encoding>UTF-8</encoding>
<!-- PLM is legacy code: many raw-type / deprecation warnings,
including the EXPECTED new ones against jgit 6.x. Do not fail
the build on them. -->
<failOnWarning>false</failOnWarning>
<compilerArgs>
<arg>-Xlint:none</arg>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<!-- Generation of C remote code from java primitives. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>generate-resources</id>
<phase>process-classes</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>plm.core.lang.primitives.CodeCreation</mainClass>
<arguments>
<!-- Add arguments if needed -->
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<!-- i18n: generate org.plm.i18n.Messages ResourceBundles from
l10n/engine/*.po so they land in the jar. Uses the gettext-commons
GenerateDefaultBundleTask (same task the ant build used), invoked
via antrun against the vendored build-only tool jar. The generated
classes are written into target/classes before packaging. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<dependencies>
<!-- gettext-commons provides the runtime + the GettextResource the
generated bundles extend; the ant task lives in the vendored
gettext-ant-tasks jar referenced on the classpath below. -->
<dependency>
<groupId>com.googlecode.gettext-commons</groupId>
<artifactId>gettext-commons</artifactId>
<version>0.9.8</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>i18n-generate-bundles</id>
<phase>process-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef name="gettext-generate-default"
classname="org.xnap.commons.ant.gettext.GenerateDefaultBundleTask">
<classpath>
<pathelement location="${project.basedir}/lib/gettext-ant-tasks-0.9.3.jar"/>
<path refid="maven.plugin.classpath"/>
</classpath>
</taskdef>
<gettext-generate-default targetBundle="org.plm.i18n.Messages"
potFile="${project.basedir}/l10n/engine/plm.pot"
poDirectory="${project.basedir}/l10n/engine"
outputDirectory="${project.build.outputDirectory}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<!-- Fat jar: a self-contained, runnable uber-jar. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>false</shadedArtifactAttached>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>module-info.class</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${main.class}</Main-Class>
<Built-By>M. Quinson, G. Oster and others</Built-By>
</manifestEntries>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<!-- PLM's tests live under src/ (compiled into the main output), not
src/test/java, so point surefire there. The tests are Swing-based:
they need a display (run the job under xvfb) and AWT must not be
headless.
We run a fast, reliable subset for now, NOT the full AllTests
suite: the exercise-runner tests (SimpleExerciseTest, LessonTest,
ExoTest, the Scala/Python variants) spin up the Scala/Jython/JRuby
engines and compile in process for every test, which takes ~45 min
and times CI out; some also rely on force-killing a runaway loop,
which no longer happens since Thread.stop() became a cooperative
Thread.interrupt(). Modernising that suite is follow-up work.
The fork timeout still guards against a hang. -->
<testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory>
<includes>
<include>**/AllTests.java</include>
<include>**/git/GitSpyTest.java</include>
<include>**/git/GitUtilsTest.java</include>
<include>**/simple/test/JavaSimpleExerciseTest.java</include>
<include>**/gui/MainFrameSmokeTest.java</include>
</includes>
<argLine>-Djava.awt.headless=false</argLine>
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
<!-- Run each test class in its own JVM. PLM is full of singletons
(Game and its Swing listeners): the GUI smoke test registers a
MainFrame/ExerciseView as a Game listener that otherwise leaks
into the exercise tests and NPEs them, and the leak surfaced only
on Windows because the test order differs per OS. A fresh fork per
class isolates that state and makes the run order-independent. -->
<reuseForks>false</reuseForks>
</configuration>
</plugin>
</plugins>
</build>
</project>