Repository navigation
Expand file tree
/
Copy pathSPS-CMP.html
More file actions
648 lines (604 loc) · 47.3 KB
/
Copy pathSPS-CMP.html
File metadata and controls
648 lines (604 loc) · 47.3 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
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<title>SPS-CMP — Software Product Specification and Configuration Management Plan</title>
<style type="text/css">
/* ===== Base ===== */
body {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 11pt;
line-height: 1.45;
color: #111;
background: #fff;
}
h1, h2, h3, h4, .toc-title, .doc-control th, .revision-history th {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
}
h2 { font-size: 1.45em; margin: 1.6em 0 0.5em; }
h3 { font-size: 1.15em; margin: 1.3em 0 0.4em; }
h4 { font-size: 1em; margin: 1.1em 0 0.3em; }
code, samp, pre { font-family: "DejaVu Sans Mono", Consolas, "Courier New", monospace; font-size: 0.92em; }
pre.grammar {
background: #f5f5f5;
border-left: 3px solid #bbb;
padding: 0.5em 0.8em;
white-space: pre-wrap;
}
dt { font-weight: bold; margin-top: 0.5em; }
dd { margin-left: 2em; }
dd > p:first-child { margin-top: 0; }
table { border-collapse: collapse; margin: 0.8em 0; }
th, td { border: 1px solid #888; padding: 0.3em 0.5em; vertical-align: top; text-align: left; }
th { background: #eee; }
table.full { width: 100%; }
table.references td:first-child { white-space: nowrap; }
.toc li { padding-left: 2.2em; text-indent: -2.2em; }
a { color: #0645ad; }
/* ===== Section numbering ===== */
.content { counter-reset: h2; }
.content h2 { counter-reset: h3; counter-increment: h2; }
.content h3 { counter-reset: h4; counter-increment: h3; }
.content h4 { counter-increment: h4; }
.content h2:before { content: counter(h2) ". "; }
.content h3:before { content: counter(h2) "." counter(h3) " "; }
.content h4:before { content: counter(h2) "." counter(h3) "." counter(h4) " "; }
/* ===== Title page ===== */
.title-page h1 { font-size: 2em; line-height: 1.2; margin: 0 0 0.4em; }
.title-page .project { font-size: 1.4em; margin: 0 0 2em; }
.doc-control th { width: 10em; }
.revision-history-title { font-family: Arial, Helvetica, sans-serif; font-weight: bold; margin: 2em 0 0.3em; }
/* ===== Table of contents ===== */
.toc-title { font-size: 1.2em; font-weight: bold; margin: 0 0 0.6em; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: item; }
.toc ol ol { padding-left: 1.4em; }
.toc li { counter-increment: item; margin: 0.15em 0; }
.toc li:before { content: counters(item, ".") " "; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
/* ===== Screen: sidebar table of contents ===== */
@media screen {
.toc {
position: fixed;
top: 0; left: 0; bottom: 0;
width: 17rem;
overflow-y: auto;
padding: 1.2rem 1rem;
box-sizing: border-box;
background: #f7f7f7;
border-right: 1px solid #ddd;
font-family: Arial, Helvetica, sans-serif;
font-size: 0.85em;
}
.page { margin-left: 17rem; padding: 1.5rem 2.5rem 4rem; max-width: 52rem; }
.title-page { border-bottom: 2px solid #ccc; padding-bottom: 1.5em; margin-bottom: 1em; }
.content h2, .content h3, .content h4 { scroll-margin-top: 1rem; }
}
/* Narrow screens: table of contents back on top */
@media screen and (max-width: 60rem) {
.toc { position: static; width: auto; border-right: none; border-bottom: 1px solid #ddd; }
.page { margin-left: 0; padding: 1rem; }
}
/* ===== Print: title page, then table of contents, then document ===== */
@page {
size: A4;
margin: 2cm 2cm 2.2cm 2cm;
@bottom-center { content: counter(page) " / " counter(pages); font-size: 9pt; }
}
@page :first {
@bottom-center { content: none; }
}
@media print {
body { font-size: 10.5pt; }
a { color: inherit; text-decoration: none; }
.title-page {
height: 25cm;
display: flex;
flex-direction: column;
break-after: page;
page-break-after: always;
}
.title-page .title-block { margin-top: 5cm; }
.title-page .revision-block { margin-top: auto; }
.toc { break-after: page; page-break-after: always; font-size: 10.5pt; }
.toc-title { font-size: 1.45em; }
h2, h3, h4, dt { break-after: avoid; page-break-after: avoid; }
table, pre, tr { break-inside: avoid; page-break-inside: avoid; }
}
</style>
</head>
<body>
<!-- ================= Title page ================= -->
<div class="page">
<div class="title-page">
<div class="title-block">
<h1>Software Product Specification and Configuration Management Plan</h1>
<p class="project">Project: java-commons</p>
<table class="doc-control">
<tr><th scope="row">Document ID</th><td>SPS-CMP-java-commons</td></tr>
<tr><th scope="row">Document version</th><td>0.1.0</td></tr>
<tr><th scope="row">Date</th><td>2026-11-18</td></tr>
<tr><th scope="row">Author</th><td>Carl Eric Codere</td></tr>
<tr><th scope="row">Organization</th><td>Optima SC Inc.</td></tr>
</table>
</div>
<div class="revision-block">
<p class="revision-history-title">Revision history</p>
<table class="revision-history full">
<thead>
<tr><th scope="col">Version</th><th scope="col">Date</th><th scope="col">Author</th><th scope="col">Description</th></tr>
</thead>
<tbody>
<tr>
<td>0.1.0</td>
<td>2026-11-18</td>
<td>Carl Eric Codere</td>
<td>Initial version, draft for review.</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- ================= Table of contents (sidebar on screen, own page in print) ================= -->
<div class="toc" id="toc">
<p class="toc-title">Contents</p>
<ol>
<li><a href="#scope">Scope</a></li>
<li><a href="#conventions">Conventions, terms and references</a>
<ol>
<li><a href="#keywords">Conventions</a></li>
<li><a href="#terms">Terms and abbreviations</a></li>
<li><a href="#references">References</a></li>
</ol>
</li>
<li><a href="#cm">Configuration management</a>
<ol>
<li><a href="#identification">Configuration identification</a></li>
<li><a href="#controlled-items">Items placed under configuration control</a></li>
<li><a href="#branching">Branching and merging policy</a></li>
<li><a href="#commits">Commit messages</a></li>
<li><a href="#dependency-policy">Dependency policy</a></li>
<li><a href="#baselines">Establishing a configuration baseline</a></li>
<li><a href="#accounting">Status accounting</a></li>
</ol>
</li>
<li><a href="#targets">Build phases</a>
<ol>
<li><a href="#main-targets">Main phases</a></li>
<li><a href="#other-targets">Other phases</a></li>
</ol>
</li>
<li><a href="#java">Java implementation</a>
<ol>
<li><a href="#java-software">Software requirements</a></li>
<li><a href="#java-hardware">Hardware requirements</a></li>
<li><a href="#java-build-config">Build system configuration</a></li>
<li><a href="#java-build-procedure">Build procedure</a></li>
<li><a href="#java-api-check">API compliance check</a></li>
<li><a href="#java-directories">Source directory structure</a></li>
<li><a href="#java-conventions">Source code conventions</a></li>
<li><a href="#java-naming">Naming conventions</a></li>
<li><a href="#java-documentation">Source code documentation conventions</a></li>
<li><a href="#java-dependencies">Dependency requirements</a></li>
<li><a href="#java-testing">Testing requirements</a></li>
<li><a href="#java-vdd">Version description documents</a></li>
</ol>
</li>
<li><a href="#deviations">Known deviations (informative)</a></li>
</ol>
</div>
<!-- ================= Document body ================= -->
<div class="content">
<h2 id="scope">Scope</h2>
<p>This document defines the rules, procedures and guidelines applied to the development of the java-commons project. It covers:</p>
<ul>
<li>configuration management: how artifacts and work products are identified, versioned and baselined;</li>
<li>the software product specification: the build phases, data packages and runtime identification that each delivered product shall provide;</li>
<li>the implementation rules and plan: build requirements, language requirements, and naming and documentation conventions.</li>
</ul>
<p>The project is a set of Java libraries that are compatible with Java 1.4 and, in some cases, with the CLDC and CDC embedded Java environments. The repository contains the following modules, built from the root of the repository:</p>
<table>
<thead>
<tr><th scope="col">Directory</th><th scope="col">Contents</th><th scope="col">API restriction</th></tr>
</thead>
<tbody>
<tr><td><code>optimasc-commons-cldc</code></td><td>Base classes for basic I/O, error management, archives, text and character set conversion.</td><td>CLDC 1.1</td></tr>
<tr><td><code>optimasc-commons-cdc</code></td><td>I/O, parsing, text processing, mathematics and date conversion utilities.</td><td>CDC 1.1 Foundation Profile</td></tr>
<tr><td><code>optimasc-datatypes</code></td><td>Datatype class representations, used to represent schemas such as SQL, XML Schema, ASN.1 or ISO/IEC 11404 datatypes.</td><td>Java SE 5</td></tr>
<tr><td><code>optimasc-schemas</code></td><td>Schema definition objects.</td><td>Java SE 5</td></tr>
</tbody>
</table>
<p>The directory <code>optimasc-datatypesex</code> is not part of the build performed from the root of the repository, and is out of the scope of this version of the document.</p>
<h2 id="conventions">Conventions, terms and references</h2>
<h3 id="keywords">Conventions</h3>
<p>The key words “shall”, “shall not”, “should”, “should not” and “may” in this document are to be interpreted as described in <cite>[ISO-DIR-2]</cite>:</p>
<dl>
<dt>shall</dt><dd>An absolute requirement. A deviation makes the work non-conforming.</dd>
<dt>shall not</dt><dd>An absolute prohibition.</dd>
<dt>should</dt><dd>A recommendation. Deviation is permitted where the reasons are understood and the consequences accepted, but the deviation should be recorded.</dd>
<dt>should not</dt><dd>A recommendation against.</dd>
<dt>may</dt><dd>A permission. The choice is left to the implementer, and neither option is preferred.</dd>
</dl>
<h3 id="terms">Terms and abbreviations</h3>
<dl>
<dt>CCB</dt><dd>Configuration Control Board: a group of people responsible for evaluating and approving or disapproving proposed changes to configuration items, and for ensuring implementation of approved changes <cite>[ISO-24765]</cite>. For this project, the board consists of the project developers.</dd>
<dt>CDC</dt><dd>Connected Device Configuration, a Java ME configuration for resource-constrained devices.</dd>
<dt>CLDC</dt><dd>Connected Limited Device Configuration, a Java ME configuration for devices more constrained than those targeted by the CDC.</dd>
<dt>EBNF</dt><dd>Extended Backus-Naur Form.</dd>
<dt>GAV</dt><dd>The groupId, artifactId and version coordinates identifying a Maven artifact.</dd>
<dt>PBL</dt><dd>Production Baseline.</dd>
<dt>POM</dt><dd>Project Object Model, the Maven project description file.</dd>
<dt>Retrotranslation</dt><dd>The transformation of class files compiled at a Java 1.5 language level into class files that run on Java 1.4, performed by the Retrotranslator tool.</dd>
<dt>VDD</dt><dd>Version Description Document, also called release notes.</dd>
<dt>Artifact</dt><dd>A work product produced by a build and identified by the data package naming conventions.</dd>
<dt>Baseline</dt><dd>A set of items formally designated at a point in time, serving as the basis for further work.</dd>
<dt>Data package</dt><dd>A distributable file containing built artifacts, resources or documentation.</dd>
<dt>Work product</dt><dd>Any item produced by the project, whether or not generated by a build.</dd>
</dl>
<h3 id="references">References</h3>
<table class="full references">
<thead>
<tr><th scope="col">Tag</th><th scope="col">Reference</th></tr>
</thead>
<tbody>
<tr><td>[ISO-DIR-2]</td><td>ISO/IEC Directives, Part 2, <em>Principles and rules for the structure and drafting of ISO and IEC documents</em></td></tr>
<tr><td>[ISO-24765]</td><td>ISO/IEC/IEEE 24765, <em>Systems and software engineering — Vocabulary</em></td></tr>
<tr><td>[ISO-14977]</td><td>ISO/IEC 14977:1996, <em>Information technology — Syntactic metalanguage — Extended BNF</em></td></tr>
<tr><td>[ISO-16684-1]</td><td>ISO 16684-1:2019, <em>Graphic technology — Extensible metadata platform (XMP) — Part 1: Data model, serialization and core properties</em></td></tr>
<tr><td>[SEMVER2]</td><td><em>Semantic Versioning 2.0.0</em>, <a href="https://semver.org/spec/v2.0.0.html">https://semver.org/spec/v2.0.0.html</a></td></tr>
<tr><td>[JLS]</td><td><em>The Java Language Specification</em>, Oracle</td></tr>
<tr><td>[JAVADOC]</td><td><em>How to Write Doc Comments for the Javadoc Tool</em>, Oracle</td></tr>
</tbody>
</table>
<h2 id="cm">Configuration management</h2>
<h3 id="identification">Configuration identification</h3>
<p>The items (work products, artifacts) placed under configuration management (tracked, stored and versioned) as well as baselining through tagging are identified with the rules defined in the following sections.</p>
<h4 id="definitions">Generic definitions</h4>
<p>Throughout this document, the following definitions are reused:</p>
<dl>
<dt><module_name></dt>
<dd>The name of one module of the repository, equal to its <code>artifactId</code> in Maven builds, for example <code>optimasc-commons-text</code>.</dd>
<dt><project_name></dt>
<dd>The project name, <samp>java-commons</samp>, used as a mnemonic for the project, such as the repository or product, throughout its lifecycle.</dd>
<dt><project_version></dt>
<dd>
<p>The actual project version, following the semantic versioning scheme <cite>[SEMVER2]</cite>.</p>
<p>The software version is composed of three parts. An increment of the MAJOR version indicates non-interchangeable or incompatible breaking changes. A MINOR version increment indicates additional functionality while keeping backward compatibility, while a PATCH version increment indicates a bug or problem fix.</p>
<p>A snapshot label, <samp>-SNAPSHOT</samp>, is appended to the project version when the software is not yet released and is still in development. This is equal to the Maven <code>version</code> element.</p>
<p>All the modules of a repository shall share one <project_version>. A new version shall be assigned to all the modules together, including modules that have not changed.</p>
</dd>
</dl>
<h4 id="baseline-id">Baseline identification</h4>
<p>When a baseline needs to be identified, the baseline identifier shall follow the rule below:</p>
<pre class="grammar">baseline_identifier ::= <project_version></pre>
<h4 id="runtime-id">Runtime identification</h4>
<p>Runtime identification of the software shall have the following format in EBNF syntax <cite>[ISO-14977]</cite>:</p>
<pre class="grammar">agent_name ::= <vendor> " " <module_name> " " <project_version> [ "(" <token> { ";" <token> } ")" ]
vendor ::= "OptimaSC"
token ::= token_char { token_char }
token_char ::= "A".."Z" | "a".."z" | "0".."9" | "-" | "." | "_"</pre>
<p>The terms are defined above, except for the following:</p>
<ul>
<li><token> can be used to identify an operating system, build variant, plug-in, or more detailed version information.</li>
</ul>
<p>The above form is equivalent to the XMP AgentName <cite>[ISO-16684-1]</cite>.</p>
<h4 id="package-naming">Data package naming conventions</h4>
<p>Each module shall produce its own data packages, named with its <module_name>. Data packages that combine several modules, such as a complete source or binary distribution, shall be named with the <project_name>.</p>
<p>The generic data package naming (main artifacts) conventions are as follows, in EBNF syntax:</p>
<pre class="grammar">data_package_name ::= ( <module_name> | <project_name> ) "-" <project_version> [ "-" <classifier> ] "." <suffix>
classifier ::= "bin" | "sources" | "autodoc" | "javadoc" | "jdk14" | "debug"
suffix ::= "jar" | "zip" | "pom" | "asc"</pre>
<p>Each new term is defined below:</p>
<dl>
<dt><classifier></dt>
<dd>The actual package qualifier:
<dl>
<dt>bin</dt><dd>The full package, including binaries (<code>zip</code> archive).</dd>
<dt>sources</dt><dd>The software source code (<code>jar</code> archive).</dd>
<dt>autodoc</dt><dd>The documentation generated from the software source code (<code>zip</code> archive).</dd>
<dt>javadoc</dt><dd>The documentation generated from the software source code, packaged for deployment to the repository (<code>jar</code> archive).</dd>
<dt>jdk14</dt><dd>The software built by the <code>jdk14</code> profile, retrotranslated to the Java 1.4 class file format.</dd>
<dt>debug</dt><dd>The debug version of the software.</dd>
</dl>
<p>The main binary artifact of a module has no classifier.</p>
</dd>
<dt><suffix></dt>
<dd>The data package suffix, depending on the artifact type. The <code>asc</code> suffix denotes the detached GnuPG signature of the artifact with the same name.</dd>
</dl>
<h3 id="controlled-items">Items placed under configuration control</h3>
<p>Items under configuration management are held by one of two mechanisms:</p>
<ul>
<li><strong>Version control</strong> — items authored by the project, stored in the repository defined in <a href="#branching">Branching and merging policy</a>. This comprises source code, build files, configuration files, test sources and test data, project documentation, and any resource required to reproduce a build from a clean checkout. Generated files shall not be committed.</li>
<li><strong>Artifact repository</strong> — items produced by a build, deployed to a snapshot or production repository as defined in <a href="#baselines">Establishing a configuration baseline</a>, and identified by the <a href="#package-naming">data package naming conventions</a>. Deployed artifacts are immutable; a correction requires a new version.</li>
</ul>
<h3 id="branching">Branching and merging policy</h3>
<p>All items under configuration management are stored in a single version control repository per project. The default branch is the branch configured as such in the repository (<code>main</code> for Git) and shall remain buildable at all times, with all unit tests passing. No long-lived feature, release or maintenance branches are used.</p>
<p>Changes authored directly by a project developer may be committed to the default branch. Changes authored wholly or partly by an automated agent or by an external contributor shall be committed to a short-lived branch and merged into the default branch only through a pull request, which shall be reviewed and approved by a project developer before merge. The approving developer may be the same developer who initiated or prompted the change. Merges shall be performed as a squash merge, producing a single commit on the default branch. Such branches shall be deleted after merge and shall not be baselined or tagged.</p>
<p>Baselines are recorded as annotated tags on the default branch, following the scheme defined in <a href="#baselines">Establishing a configuration baseline</a>.</p>
<h3 id="commits">Commit messages</h3>
<p>Each commit message consists of a summary line of at most 72 characters, written in the imperative mood, optionally followed by a blank line and a detailed description.</p>
<p>Where a change was authored wholly or partly by an automated agent, the commit message shall end with a trailer identifying it:</p>
<pre class="grammar">Agent: <tool_name> <tool_version></pre>
<p>The trailer is placed on its own line, after any blank line separating it from the description.</p>
<h3 id="dependency-policy">Dependency policy</h3>
<p>This policy applies to dependencies distributed with or linked by the software, including transitive dependencies, and to third-party source code incorporated directly into the repository. Tools executed during the build but not distributed, such as the Retrotranslator tool and the test framework, are not subject to it.</p>
<p>The project itself is distributed under the Apache License 2.0.</p>
<ul>
<li>A production baseline (PBL) shall not contain any dependency whose version carries the <samp>-SNAPSHOT</samp> label, and the project version at a PBL shall not carry that label. Only released versions shall be used. The exception is the other modules of this repository, which are released together with the same <project_version>.</li>
<li>Permitted licences: works dedicated to the public domain (CC0 1.0, Unlicense); MIT; ISC; BSD 2-Clause and 3-Clause; Zlib; Apache License 1.1; Apache License 2.0; Mozilla Public License 2.0; Eclipse Public License 1.0 and 2.0; Common Public License 1.0.</li>
<li>Dependencies under MPL 2.0, EPL or CPL may be used unmodified. Where such a dependency is modified or forked, the modified files remain under their original licence and shall be published accordingly.</li>
<li>Dependencies under the GPL, AGPL, LGPL, SSPL, or any licence prohibiting commercial use or derivative works shall not be used. A dependency with no stated licence shall be treated as all rights reserved and shall not be used.</li>
<li>Licences requiring acknowledgement in advertising materials, including the BSD 4-Clause Licence, shall not be used.</li>
<li>Required copyright notices, and any acknowledgement or NOTICE content required by the Apache License 1.1 or 2.0, shall be reproduced in a <code>THIRD-PARTY-NOTICES</code> file at the root of each distribution archive.</li>
</ul>
<h3 id="baselines">Establishing a configuration baseline</h3>
<p>This section lists the different baselines that exist for this project as well as the rules associated with these baselines.</p>
<p>Two types of baseline are available. The Production Baseline (PBL) is used for software to be used in production. It is allocated by the Configuration Control Board (CCB) when the project is ready for release, and consists of the following actions being completed:</p>
<ul>
<li>A version description document is generated and is available.</li>
<li>Items under version control used for building the production data packages and/or distribution archives are tagged with a tag name equal to <samp>v</samp> followed by the <baseline_identifier>, for example <samp>v1.2.0</samp>.</li>
<li>A software label identifying the version is available at runtime.</li>
<li>Generated data packages and/or distribution archives are deployed to the production repository.</li>
</ul>
<p>The developmental baseline is used when non-stable software, which has minimal working functionality, needs to be released for testing or to a wider selected audience. This baseline can be allocated at any time deemed necessary by the Configuration Control Board. It consists of the following:</p>
<ul>
<li>Generated data packages and/or distribution archives are deployed to a snapshot repository.</li>
</ul>
<h3 id="accounting">Status accounting</h3>
<p>This section describes the schedule for generating configuration status reports as well as their contents. The current status reports are as follows:</p>
<ul>
<li>Version description document</li>
</ul>
<p>The version description document is generated before the establishment of a PBL.</p>
<h4 id="vdd-content">Version description document content</h4>
<p>A version description document, also called release notes, shall contain the following information, available at each production baseline (PBL) for each module:</p>
<ul>
<li>A brief statement of the purpose of the software and the environments to which this document applies.</li>
<li>Prerequisites for usage of the software, such as minimum operating environment requirements or dependency information.</li>
<li>The list of all important changes incorporated into the software version since the previous version.</li>
<li>Installation or build instructions.</li>
<li>Known issues and problems.</li>
</ul>
<p>The version description document is an artifact available in the deployment repository. The files that carry it are defined in <a href="#java-vdd">Version description documents</a>.</p>
<h2 id="targets">Build phases</h2>
<p>The following Maven phases apply to all modules. Phases executed from the root of the repository apply to all its modules, in dependency order.</p>
<h3 id="main-targets">Main phases</h3>
<dl>
<dt>clean</dt>
<dd>Clean all files generated by compiling and preparation of the distribution files. Among others it cleans generated resources, documentation, compilation artifacts and data packages. It does not however delete build configuration data used for building.</dd>
<dt>compile</dt>
<dd>Compiles the software and generates all related data used directly by the software (such as resources). In the default <code>dev</code> profile, compilation includes source file and line number debugging information.</dd>
<dt>test</dt>
<dd>Test the compiled source code through a unit testing framework. Testing does not require the software to be deployed or installed beforehand.</dd>
<dt>package</dt>
<dd>
<p>Create the data packages of the module defined in <a href="#package-naming">Data package naming conventions</a>. With the <code>release</code> profile, this phase also creates the distribution archives containing the binaries, resources and documentation, described by the assembly descriptors in <code>src/assembly</code>. The root of each archive is the directory name of the software with its version, for example <samp>optimasc-datatypes-1.0.0</samp>.</p>
</dd>
<dt>install</dt>
<dd>Installs the data packages into the local repository, for use as a dependency in other projects locally.</dd>
<dt>deploy</dt>
<dd>Copies the final data packages or distribution archives to the remote repository for sharing with others.</dd>
</dl>
<h3 id="other-targets">Other phases</h3>
<dl>
<dt>initialize</dt>
<dd>Used to initialize build state, e.g. set properties or create directories.</dd>
<dt>generate-sources</dt>
<dd>Generate any source code or resources for inclusion in compilation.</dd>
<dt>prepare-package</dt>
<dd>Generates the API documentation from the source code (Javadoc) and, with the <code>release</code> profile, the change list announcement.</dd>
<dt>verify</dt>
<dd>Attaches the source package and, with the <code>release</code> profile, signs the data packages.</dd>
<dt>site</dt>
<dd>Generates the project site, including the API documentation and the change report.</dd>
</dl>
<h2 id="java">Java implementation</h2>
<h3 id="java-software">Software requirements</h3>
<p>The following requirements are needed to build and package the software:</p>
<ul>
<li>A Java Development Kit whose compiler accepts the Java 1.4 and 1.5 source and target levels. The original Java 1.4 JDK is the reference compiler. JDK 8 has also been used to build the software. Later JDKs removed support for these levels and cannot be used. The location of this JDK is passed to the build in the <code>JAVA1_4_HOME</code> property.</li>
<li>Maven version 3.2.5 or later, run with a JDK supported by the Maven version used. The build has been verified with Maven 3.9.11 run with JDK 8.</li>
<li>JUnit 3.8.2 testing framework, resolved by Maven.</li>
<li>GnuPG, used for signing the artifacts and deployment to Maven Central:
<ul>
<li>public/private key pairs associated with the deployment.</li>
</ul>
</li>
</ul>
<p>Java compilation follows the Maven POM model version 4.0.0.</p>
<h3 id="java-hardware">Hardware requirements</h3>
<ul>
<li>At least 40 MiB of free hard disk space.</li>
</ul>
<h3 id="java-build-config">Build system configuration</h3>
<p>All modules automatically generate a standard <code>MANIFEST.MF</code> file, which shall contain at minimum the following information, if specified in the Maven project file:</p>
<dl>
<dt>Implementation-Vendor</dt><dd><code>${project.organization.name}</code> property</dd>
<dt>Implementation-Title</dt><dd><code>${project.name}</code> property</dd>
<dt>Implementation-Version</dt><dd><code>${project.version}</code> property</dd>
<dt>Build_Target</dt><dd>The Java runtime target</dd>
<dt>Module-Name</dt><dd><code>${project.artifactId}</code> property</dd>
</dl>
<p>The version shall be defined once, in the parent POM of the repository, and inherited by every module.</p>
<p>The Maven POM files contain the following profiles:</p>
<dl>
<dt>dev</dt>
<dd>Builds the artifacts for deployment to a local repository with optimizations enabled and limited debugging information (source and line information, <code>-g:source,lines</code>), as well as API documentation and source packages. This is the <em>default</em> active profile when building.</dd>
<dt>jdk14</dt>
<dd>Compiles at the Java 1.5 source and target level and retrotranslates the classes to the Java 1.4 class file format, which is compatible with the CDC Foundation Profile. The resulting package has the <code>jdk14</code> classifier.</dd>
<dt>debug</dt>
<dd>Generates the debug executable artifacts with the <code>debug</code> classifier for local repository deployment with full debugging information — source file names, line information and local variable information (<code>-g</code>). API documentation and source packages are not generated.</dd>
<dt>release</dt>
<dd>Generates the release artifacts for deployment to the deployment repository with optimization, signing and limited debugging information, as well as generic binary and documentation packages for local web site distribution. It also verifies, with the Animal Sniffer plugin, that the runtime library use complies with the API signature of the target environment defined in <a href="#java-conventions">Source code conventions</a>.</dd>
</dl>
<p>The following properties may be modified to change some of the options:</p>
<dl>
<dt>JAVA1_4_HOME</dt><dd>Sets the location of the JDK whose compiler is used to compile the software.</dd>
<dt>maven.compiler.source</dt><dd>Sets the source version for compilation. This shall be set to 1.4, except for modules specified as Java 5 in <a href="#java-conventions">Source code conventions</a> and for the <code>jdk14</code> profile, where it shall be set to 1.5.</dd>
<dt>maven.compiler.target</dt><dd>Sets the target version for compilation, with the same values as <code>maven.compiler.source</code>.</dd>
<dt>gpg.keyname</dt><dd>Sets the key ID used for signing the artifacts.</dd>
</dl>
<h3 id="java-build-procedure">Build procedure</h3>
<p>The following steps should be followed for project building and deployment, from the root of the repository. The <code>JAVA1_4_HOME</code> property is given on the command line, for example <code>-DJAVA1_4_HOME=/path/to/jdk</code>, unless it is already defined in the Maven settings.</p>
<ol>
<li>Execute <code>mvn install</code> to build, test and install the <code>dev</code> profile package for day-to-day development.</li>
<li>Execute <code>mvn -P debug install</code> to build and install the <code>debug</code> profile packages.</li>
<li>Execute <code>mvn -P jdk14 install</code> to build and install the packages retrotranslated to Java 1.4.</li>
<li>Execute <code>mvn site</code> to build the documentation associated with the project.</li>
<li>Execute <code>mvn -P release package</code> to generate and sign the standard release artifacts, as well as independently installable release packages.</li>
<li>Execute <code>mvn -P release deploy</code> to generate, sign and deploy the standard release artifacts, as well as independently installable release packages.</li>
</ol>
<h3 id="java-api-check">API compliance check</h3>
<p>The class library API used by each module shall comply with the target environment defined in <a href="#java-conventions">Source code conventions</a>. This is verified on the compiled classes by the Animal Sniffer Maven plugin, which compares every class, method and field referenced by the classes of the module with an API signature of the target environment.</p>
<p>The check is part of the <code>release</code> profile and is executed in the <code>process-classes</code> phase, so it runs as part of every <code>mvn -P release package</code> and <code>mvn -P release deploy</code>. The signatures are released artifacts on Maven Central, and the POMs shall reference released versions, not <samp>-SNAPSHOT</samp> versions:</p>
<table class="full">
<thead>
<tr><th scope="col">Module</th><th scope="col">Signature (groupId:artifactId:version)</th></tr>
</thead>
<tbody>
<tr><td><code>optimasc-commons-cldc</code></td><td><code>com.optimasc.signatures:cldc11:1.1.0</code></td></tr>
<tr><td><code>optimasc-commons-cdc</code></td><td><code>com.optimasc.signatures:cdc11fpxml:1.1.0</code>. The signature <code>com.optimasc.signatures:cdc11fp:1.1.0</code>, which does not include the XML APIs, is also published and may be used by modules that do not use them.</td></tr>
<tr><td><code>optimasc-datatypes</code>, <code>optimasc-schemas</code></td><td><code>org.codehaus.mojo.signature:java15:1.0</code></td></tr>
</tbody>
</table>
<p>To run only the check, from the root of the repository, without running the tests or signing:</p>
<pre class="grammar">mvn -P release -DJAVA1_4_HOME=/path/to/jdk -DskipTests process-classes</pre>
<p>To check only some modules, name the modules and not their parent directory, and add <code>-am</code> so that the modules they depend on are built. For example, <code>-pl optimasc-commons-cdc/common-lang -am</code>. Selecting only the parent directory <code>optimasc-commons-cdc</code> checks its POM and none of its modules.</p>
<p>A violation is reported as an error naming the undefined reference and the class that contains it, for example:</p>
<pre class="grammar">[ERROR] Undefined reference: java/math/BigDecimal.<init>(J)V in .../NumberComparator.class</pre>
<p>The source code shall be changed to use an API that is part of the signature, and the build fails until it is. The class files checked shall be those of the current build, so <code>clean</code> shall be executed first when the compiler, its target level or the profile changed since the last build. The plugin version used cannot read class files built for a recent Java level, such as Java 8, and fails on them with an <code>IllegalArgumentException</code>.</p>
<h3 id="java-directories">Source directory structure</h3>
<p>Source code follows the Maven directory structure, in each module:</p>
<table>
<thead>
<tr><th scope="col">Directory</th><th scope="col">Contents</th></tr>
</thead>
<tbody>
<tr><td><code>src/main/java</code></td><td>Production source code</td></tr>
<tr><td><code>src/main/resources</code></td><td>Production resources</td></tr>
<tr><td><code>src/test/java</code></td><td>Test source code</td></tr>
<tr><td><code>src/test/resources</code></td><td>Test data</td></tr>
<tr><td><code>src/assembly</code></td><td>Assembly descriptors of the distribution archives</td></tr>
<tr><td><code>src/changes</code></td><td>Change list (<code>changes.xml</code>)</td></tr>
<tr><td><code>doc</code></td><td>Project documentation</td></tr>
<tr><td><code>target</code></td><td>Generated build output</td></tr>
</tbody>
</table>
<p>The <code>target</code> directory is generated and shall not be committed. The <code>doc</code> directory at the root of the repository holds this document.</p>
<h3 id="java-conventions">Source code conventions</h3>
<ul>
<li>Source code shall be encoded in UTF-8 with no BOM, and lines shall end with a line-feed character (following the UNIX convention for line endings).</li>
<li>The language syntax and class file format target Java 1.4. Generics, annotations, enumerations, variable-length argument lists, autoboxing and the enhanced <code>for</code> statement shall therefore not be used. The exception is the <code>optimasc-schemas</code> module, which is compiled at the Java 1.5 level.</li>
<li>The class library API is restricted to that of the target environment of the module:
<ul>
<li><code>optimasc-commons-cldc</code>: CLDC 1.1;</li>
<li><code>optimasc-commons-cdc</code>: CDC 1.1 Foundation Profile;</li>
<li><code>optimasc-datatypes</code> and <code>optimasc-schemas</code>: Java SE 5.</li>
</ul>
</li>
<li>The use of the runtime library shall be verified during the build of the <code>release</code> profile, through the API signature check of the Animal Sniffer plugin.</li>
<li>Class literals (for example <code>Long.class</code>) shall not be used in the <code>optimasc-commons-cldc</code> modules. For a target below Java 1.5, the compiler translates them to a synthetic <code>class$</code> method that calls <code>Throwable.initCause()</code>, which is not part of the CLDC 1.1 API. Classes shall be compared by name instead, for example <code>target.getName().equals("java.lang.Long")</code>.</li>
<li>Fields and methods used strictly internally shall be declared <code>protected</code> rather than <code>private</code>, so that derived classes may reuse them. <code>private</code> shall be used only where a subclass overriding or accessing the member could break a documented class invariant, or where a specific target runtime is demonstrated to benefit from non-virtual dispatch.</li>
<li>The indentation style shall follow the Allman style. This style puts the block statement start character (brace) associated with a control statement on the next line, indented to the same level as the control statement. Statements within the block are indented to the next level.</li>
<li>Each indentation level consists of 2 space characters (ASCII character 32). For example, a 2-level-deep indentation is 4 characters.</li>
<li>Each source code line has a maximum width of 80 characters. When a line needs to be split, each subsequent line is indented by 1 level.</li>
<li>Public methods shall validate their arguments and throw <code>IllegalArgumentException</code> for values outside the documented range, or <code>NullPointerException</code> for a null argument where null is not accepted. Protected and package-private methods may assume valid arguments where the calling contract is documented.</li>
<li>Dates and times shall be represented with the proleptic Gregorian calendar, as specified in ISO 8601, in the datatype classes. A <code>java.util.GregorianCalendar</code> that uses another Gregorian cutover date shall be converted before use.</li>
</ul>
<h3 id="java-naming">Naming conventions</h3>
<p>Naming shall follow the conventions of <cite>[JLS]</cite> and Oracle's Code Conventions for the Java Programming Language, as summarized below.</p>
<table class="full">
<thead>
<tr><th scope="col">Identifier type</th><th scope="col">Case / format</th><th scope="col">Rule</th><th scope="col">Examples</th></tr>
</thead>
<tbody>
<tr>
<td>Classes</td><td><code>PascalCase</code></td>
<td>Should be nouns that are simple and descriptive.</td>
<td><code>Customer</code>, <code>OrderService</code>, <code>HTTPRequestHandler</code>, <code>URI</code></td>
</tr>
<tr>
<td>Interfaces</td><td><code>PascalCase</code></td>
<td>Often nouns or adjectives indicating a capability.</td>
<td><code>Runnable</code>, <code>Serializable</code></td>
</tr>
<tr>
<td>Methods</td><td><code>lowerCamelCase</code></td>
<td>Should be verbs or verb phrases that clearly indicate the action.</td>
<td><code>run()</code>, <code>getBackground()</code>, <code>calculateSum()</code></td>
</tr>
<tr>
<td>Fields, parameters and variables</td><td><code>lowerCamelCase</code></td>
<td>Should be short yet meaningful nouns that describe their purpose. <code>i</code>, <code>j</code> and <code>k</code> may be used as temporary integer variable names for counter or index variables in loop constructs.</td>
<td><code>index</code>, <code>i</code>, <code>firstName</code>, <code>width</code>, <code>baseURI</code></td>
</tr>
<tr>
<td>Constants</td><td><code>UPPER_SNAKE_CASE</code></td>
<td>Written in all capital letters with words separated by underscores.</td>
<td><code>MAX_LENGTH</code>, <code>WIDTH</code></td>
</tr>
<tr>
<td>Packages</td><td><code>lowercase</code></td>
<td>Always completely lowercase. Uses a reverse internet domain style for global uniqueness. The default package prefix is <code>com.optimasc</code>.</td>
<td><code>com.optimasc.module</code></td>
</tr>
</tbody>
</table>
<p>Abbreviations and acronyms shall be written in full upper case in every identifier type that uses PascalCase or lowerCamelCase.</p>
<h3 id="java-documentation">Source code documentation conventions</h3>
<p>All code documentation shall follow the standard Javadoc conventions as defined by <cite>[JAVADOC]</cite>, and shall be written in English. The Javadoc generation should complete without errors.</p>
<ul>
<li>Each publicly visible identifier shall be documented with its purpose.</li>
<li>Each non-publicly visible method shall be documented with its purpose.</li>
<li>Each identifier may be documented with any limitations and constraints on its usage.</li>
<li>Each publicly visible package may be documented with additional detail on its usage in a separate <code>package.html</code> file.</li>
</ul>
<p>Classes and interfaces shall include a summary sentence describing the class's purpose and role within the architecture, followed by a detailed description covering intended usage and relationship to other classes in the framework. Each publicly visible class or interface shall state whether it is thread-safe. Classes shall include <code>@author</code> and should include <code>@since</code> tags. The <code>@since</code> tag value is based on the project version.</p>
<p>Fields shall include a summary sentence describing the field's purpose and the meaning of its value. Constants shall document their specific value and where they are used.</p>
<p>Methods shall include:</p>
<ol>
<li>A summary sentence (the first sentence, ending at the first period followed by whitespace) that concisely states what the method does. This sentence appears in Javadoc index pages and must be self-contained.</li>
<li>A detailed description, when warranted, explaining behaviour, preconditions, postconditions and side effects.</li>
<li>An <code>@param</code> tag for every parameter, describing its purpose, valid range, and whether null is accepted. Just before the description of the parameter, a qualifier in brackets states the direction of the parameter: <code>[in]</code> if it is strictly an input parameter, <code>[out]</code> if it is strictly a parameter updated by the method, and <code>[in,out]</code> if its contents are used both as input and output. The direction convention is project-defined rather than standard Javadoc.</li>
<li>An <code>@return</code> tag describing the return value and its meaning, including possible null returns.</li>
<li>An <code>@throws</code> tag for every checked exception, documenting the specific conditions under which it is thrown. Unchecked exceptions (e.g. <code>IllegalArgumentException</code>, <code>NullPointerException</code>) shall be documented with <code>@throws</code> when the method explicitly validates and throws them.</li>
<li>Where a method accepts or returns null, this shall be stated in the corresponding <code>@param</code> or <code>@return</code> tag. Absent such a statement, null is neither accepted nor returned.</li>
</ol>
<p>Where the behaviour of a method changes, its documentation shall be updated in the same change.</p>
<h3 id="java-dependencies">Dependency requirements</h3>
<p>In addition to the <a href="#dependency-policy">dependency policy</a>:</p>
<ul>
<li>Module external dependencies shall be limited to only what is mandatory.</li>
<li>A dependency shall be compatible with the language level and runtime target of the module using it. The modules for the CLDC and CDC environments shall depend only on modules for the same or a more constrained environment.</li>
</ul>
<h3 id="java-testing">Testing requirements</h3>
<p>Testing shall be based on JUnit 3.8.2, run by the Maven Surefire plugin during the <code>test</code> phase.</p>
<p>Test classes shall reside in the same package as the class under test, with a name formed by appending <code>Test</code> to the name of that class. For example, the tests for <code>com.optimasc.entity.Entity</code> are in <code>com.optimasc.entity.EntityTest</code>. Test classes that predate this rule and are named otherwise may keep their name.</p>
<p>All unit tests shall pass before a change is merged into the default branch.</p>
<h3 id="java-vdd">Version description documents</h3>
<p>The list of changes shall be <code>src/changes/changes.xml</code>, in the format of the Maven Changes plugin. It shall be published as <code>CHANGES.txt</code> in the release artifacts and as a changes report on the project site.</p>
<p>The remaining information required for the version description shall be placed in the <code>README.md</code> Markdown file at the root of the repository.</p>
<h2 id="deviations">Known deviations (informative)</h2>
<p>At version 0.1.0 of this document, the repository does not yet conform to the following requirements. Each entry should be removed from this table when it is resolved.</p>
<table class="full">
<thead>
<tr><th scope="col">Requirement</th><th scope="col">Current state</th></tr>
</thead>
<tbody>
<tr><td>One <a href="#definitions"><project_version></a> for all modules, defined once in the parent POM.</td><td>The root POM (<code>simple-parent</code>) is version 1.0.0, while the four builds below it (<code>common-cldc</code>, <code>common</code>, <code>optimasc-datatypes</code>, <code>optimasc-schema</code>) are version 0.0.1-SNAPSHOT, have no common parent and use different groupIds. Dependencies between them hard-code the version.</td></tr>
<tr><td><a href="#java-software">Compiler location</a> given by <code>JAVA1_4_HOME</code>.</td><td>The parent POMs of <code>optimasc-commons-cldc</code> and <code>optimasc-commons-cdc</code> fork the compiler from <code>${JAVA1_4_HOME}</code>. The POMs of <code>optimasc-datatypes</code> and <code>optimasc-schemas</code> have this setting commented out, with a differently spelled property (<code>JAVA_1_4_HOME</code>), and use the compiler of the JDK running Maven.</td></tr>
<tr><td><a href="#java-build-config">Manifest entry</a> <code>Module-Name</code> and <a href="#runtime-id">runtime identification</a>.</td><td>Not implemented.</td></tr>
<tr><td><a href="#baselines">Tag name</a> <samp>v</samp><baseline_identifier>.</td><td>The Maven Release plugin is configured without a <code>tagNameFormat</code>, so its default tag name format is used.</td></tr>
<tr><td><a href="#dependency-policy">Dependency policy</a> checked during the <code>release</code> profile.</td><td>No automated check exists. The Maven Release plugin refuses SNAPSHOT dependencies, but licences are not checked.</td></tr>
<tr><td>Javadoc generation <a href="#java-documentation">should complete without errors</a>.</td><td>The Javadoc plugin is configured with <code>failOnError</code> set to <code>false</code>, so Javadoc errors do not fail the build.</td></tr>
<tr><td><a href="#java-conventions">Source files with LF line endings</a>.</td><td>About a third of the production source files use CRLF line endings.</td></tr>
<tr><td>A <code>THIRD-PARTY-NOTICES</code> file in each distribution archive.</td><td>No such file exists.</td></tr>
<tr><td><code>optimasc-datatypesex</code> is part of the project.</td><td>It has a POM but is not listed as a module of the root POM.</td></tr>
</tbody>
</table>
</div>
</div>
</body>
</html>