This file is indexed.

/usr/share/doc/maven-repo-helper/reference.html is in maven-repo-helper 1.8.5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Maven Repo Helper reference</title>
<style type="text/css">

pre { /* the pre makes the border */
    margin: 0.5em 0;
    padding: 10pt;
    border: 1pt solid #AEBDCC;
    background-color: #F3F5F7;
    color: black;
}

pre code { /* the code has no border and is inside the pre */
    margin: 0;
    padding: 0;
    border: none;
}


</style>
</head>
<body>
<div class="document">


<p><a class="reference external" href="repository.html">repository specification</a> |
<a class="reference external" href="reference.html">reference</a> | <a class="reference external" href="tutorial.html">tutorial</a></p>
<div class="section" id="reference-for-maven-repo-helper">
<h1>Reference for Maven Repo Helper</h1>
<div class="section" id="working-with-pom-files">
<h2>Working with POM files</h2>
<p>In Maven, POM files are xml files containing the full definition of a
project and how to build it. maven-repo-helper can manipulate them in
order to clean unecessary cruft and integrate seamlessly in a Debian
environment.
mh_cleanpom:
~~~~~~~~~~~~~</p>
<p>Usage:</p>
<pre class="literal-block">
mh_cleanpom [option]... [pom] [target] [pom-props]
</pre>
<p>Cleans the POM and prepare it for inclusion in the Maven repository.
Also extracts some information from the POM.</p>
<p>Where:</p>
<pre class="literal-block">
[pom] is the location of the POM file to clean.
  Default to pom.xml or debian/pom.xml
[target] is where the cleaned POM is written to.
  Default to debian/tmp/pom.xml
[pom-props] is where the POM properties file will be written.
  Default to debian/tmp/pom.properties
</pre>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain this POM file
-h --has-package-version: flag that indicates that this POM has the same version as the package, this helps packagers of depending packages
-o --no-parent: don't inherit from a parent POM
-k --keep-pom-version: keep the original version of the POM but convert all other versions in dependencies and plugins.
  If there is a parent POM, keeps its version except when the parent is already registered in the Maven repository
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the POM, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
-R&lt;rule&gt;, --extra-rule=&lt;rule&gt;: additional rule to apply when cleaning the POM. May occur multiple times, instead of or in addition to -r
-u&lt;rules&gt; --published-rules=&lt;rules&gt;: path to the file containing the extra rules to publish in the property debian.mavenRules in the cleaned POM.
  Optional, the default location is debian/maven.publishedRules
-U&lt;rule&gt;, --extra-published-rule=&lt;rule&gt;: extra rule to publish. May occur multiple times, instead of or in addition to -u
-i&lt;rules&gt; --ignore-rules=&lt;rules&gt;: path to the file containing the rules used to remove certain dependencies from the cleaned POM.
  Optional, the default location is debian/maven.ignoreRules
-I&lt;rule&gt;, --extra-ignore-rule=&lt;rule&gt;: additional rule used to remove dependencies from the transformed POM May occur multiple times, instead of or in addition to -i
-c&lt;rules&gt; --clean-ignore-rules=&lt;rules&gt;: path to the file containing the rules use to remove certain dependencies from the cleaned POM, in addition to the ignore rules specified previously.
  This is useful in  situations such as when the Maven clean target requires more  dependencies or plugins to ignore than the build target.
  Optional, it is ignored by default
-s --no-rules: don't apply any rules for converting versions, do not even convert versions to the default 'debian' version
--no-publish-used-rule: don't publish the rule used to transform a POM's own attributes in debian.mavenRules
--keep-elements=&lt;elem1,elem2&gt;: keep the elements listed here even if they are normally removed by the clean operation. Such elements are build,reports,reporting,prerequisites,profiles.
-m&lt;repo root&gt;--maven-repo=&lt;repo root&gt;: location of the Maven repository, used to force the versions of the Maven plugins used in the current POM file with the versions found in the repository
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
</pre>
<p>Cleans a Maven POM and prepare it for inclusion in the Debian repository
for Maven.</p>
<p>The POM will be normalised, and its parent tag removed if the option
--no-parent is given. The version will be replaced by 'debian', unless a
special rule applies (see below the discussion about rules). Build,
profiles and other build time only sections of the POM will be stripped.</p>
<p>If versions are given for a dependency, this version will be replaced by
the 'debian' version, or a rule can be given to use a custom version.</p>
<p>You can modify those defaults with the help of the rules file. This file
should contain the lines with the format:</p>
<pre class="literal-block">
&lt;groupId&gt; [artifactId] [type]  [version]  [classifier] [scope]
</pre>
<p>where groupId, artifactId, type, version, classifier and scope can be
the explicit attribute to match, or can contain a wildcard (*) for
generic matches.</p>
<p>Each one of those elements can also be a replace rule, of the form
s/&lt;regex&gt;/&lt;replace&gt;/ where regex is a regular expression, and replace is
the replacement. Substitution groups $1 $2... can be used in the
replacement if capture groups () have been used in the regex.</p>
<p>The first element is mandatory (groupId), but you can ignore the
elements on the right hand side. If the scope is missing, then any scope
is matched and left unchanged. If the version missing, then any version
will be replaced with 'debian'. If type is missing, then any type is
matched and left unchanged. If artifactId is missing, then any
artifactId is matched and left unchanged.</p>
<p>You can also have comments in this file, it should be a line starting
with #</p>
<p>Example of a rules file:</p>
<pre class="literal-block">
s/commons-(.*)/org.apache.commons.commons$1/  org.itext * * s/1\..*/1.x/ org.itext * *
s/2\..*/2.x/ # use the alpha version of  plexus-container-default  org.codehaus.plexus
plexus-container-default jar s/1\.0-alpha.*/1.0-alpha/
</pre>
<p>This rules file does the following:</p>
<ul class="simple">
<li>all groupIds starting with commons- will have org.apache.commons.
prefixed to them</li>
<li>any artifact in the org.itext group with a version number starting
with 1. will use the 1.x version</li>
<li>any artifact in the org.itext group with a version number starting
with 2. will use the 2.x version</li>
<li>the jar with groupId=org.codehaus.plexus and
artifactId=plexus-container-default and a version starting with
1.0-alpha- will use the 1.0-alpha version</li>
</ul>
<p>The default rule (* * * s/.*/debian/ *) replaces any version number
with the 'debian' version and always applies last if there was no other
matches. Another default rule (* * maven-plugin * *) keeps the
version for all plugins as the plugin mechanism requires a version in
Maven.</p>
<p>Any rules given on the command line (using -R/--extra-rule,
-U/--extra-published-rule or -I/--extra-ignore-rule) are applied in the
order given, in between the rules given in the rules file (if any) and
the default rules.</p>
<p>This script is used by mh_installpom, normally you don't need to use it
directly, except if you need to investigate an issue with the cleaning
process for a POM file.
mh_installpom:
~~~~~~~~~~~~~~~</p>
<p>Usage:</p>
<pre class="literal-block">
mh_installpom [option]... [pom]
</pre>
<p>Installs the POM file in /usr/share/maven-repo, at the correct location
for Maven. Before installing the POM, it prepares it with mh_cleanpom.</p>
<p>Where:</p>
<pre class="literal-block">
[pom] is the location of the POM file to install.
  GroupId, artifactId and version will be extracted from this file.
</pre>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain this POM file
-h --has-package-version: flag that indicates that this POM has the same version as the package, this helps packagers of depending packages
-o --no-parent: don't inherit from a parent POM
-k --keep-pom-version: keep the original version of the POM but convert all other versions in dependencies and plugins.
  If there is a parent POM, keeps its version except when the parent is already registered in the Maven repository
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the POM, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
-u&lt;rules&gt; --published-rules=&lt;rules&gt;: path to the file containing the extra rules to publish in the property debian.mavenRules in the cleaned POM.
  Optional, the default location is debian/maven.publishedRules
-i&lt;rules&gt; --ignore-rules=&lt;rules&gt;: path to the file containing the rules used to remove certain dependencies from the cleaned POM.
  Optional, the default location is debian/maven.ignoreRules
-c&lt;rules&gt; --clean-ignore-rules=&lt;rules&gt;: path to the file containing the rules use to remove certain dependencies from the cleaned POM, in addition to the ignore rules specified previously.
  This is useful in  situations such as when the Maven clean target requires more  dependencies or plugins to ignore than the build target.
  Optional, it is ignored by default
-s --no-rules: don't apply any rules for converting versions, do not even convert versions to the default 'debian' version
--no-publish-used-rule: don't publish the rule used to transform a POM's own attributes in debian.mavenRules
--keep-elements=&lt;elem1,elem2&gt;: keep the elements listed here even if they are normally removed by the clean operation. Such elements are build,reports,reporting,prerequisites,profiles.
-m&lt;repo root&gt;--maven-repo=&lt;repo root&gt;: location of the Maven repository, used to force the versions of the Maven plugins used in the current POM file with the versions found in the repository
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
-ignore-pom: read the POM but don't install it
</pre>
<p>This script installs the POM file in /usr/share/maven-repo, at the
correct location for Maven. Before installing the POM, it prepares it
with mh_cleanpom.</p>
<p>debian/maven.rules is used to alter the version properties for the
library and its dependencies.</p>
<p>Prefer to use mh_installpoms as it reuses the information defined in
debian/$package.poms and avoids repetition.
mh_installpoms:
~~~~~~~~~~~~~~~~</p>
<p>Usage:</p>
<pre class="literal-block">
mh_installpoms [option]...
</pre>
<p>Reads the file debian/$package.poms and installs each POM file listed in
the .poms file. Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain this POM file
-h --has-package-version: flag that indicates that this POM has the same version as the package, this helps packagers of depending packages
-k --keep-pom-version: keep the original version of the POM but convert all other versions in dependencies and plugins.
  If there is a parent POM, keeps its version except when the parent is already registered in the Maven repository
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the POM, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
-u&lt;rules&gt; --published-rules=&lt;rules&gt;: path to the file containing the extra rules to publish in the property debian.mavenRules in the cleaned POM.
  Optional, the default location is debian/maven.publishedRules
-i&lt;rules&gt; --ignore-rules=&lt;rules&gt;: path to the file containing the rules used to remove certain dependencies from the cleaned POM.
  Optional, the default location is debian/maven.ignoreRules
-c&lt;rules&gt; --clean-ignore-rules=&lt;rules&gt;: path to the file containing the rules use to remove certain dependencies from the cleaned POM, in addition to the ignore rules specified previously.
  This is useful in  situations such as when the Maven clean target requires more  dependencies or plugins to ignore than the build target.
  Optional, it is ignored by default
-s --no-rules: don't apply any rules for converting versions, do not even convert versions to the default 'debian' version
--no-publish-used-rule: don't publish the rule used to transform a POM's own attributes in debian.mavenRules
--keep-elements=&lt;elem1,elem2&gt;: keep the elements listed here even if they are normally removed by the clean operation. Such elements are build,reports,reporting,prerequisites,profiles.
-m&lt;repo root&gt;--maven-repo=&lt;repo root&gt;: location of the Maven repository, used to force the versions of the Maven plugins used in the current POM file with the versions found in the repository
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
</pre>
<p>debian/maven.rules is used to alter the version properties for the
library and its dependencies.</p>
<p>The file debian/$package.poms should contain the relative paths to the
POM files to install, each POM file in a separate line. After the path
to the POM file, you can add options which will influence the cleaning
of the POM file:</p>
<pre class="literal-block">
--ignore: ignore this POM and its artifact if any
--no-parent: remove the &lt;parent&gt; tag from the POM
--package=&lt;package&gt;: an alternative package to use when installing this POM and its artifact
--has-package-version: to indicate that the original version of the POM is the same as the upstream part of the version for the package.
--keep-elements=&lt;elem1,elem2&gt;: a list of XML elements to keep in the POM during a clean operation with mh_cleanpom or mh\_installpom
--artifact=&lt;path&gt;: path to the build artifact associated with this POM, it will be installed when using the command mh_install
--java-lib: install the jar into /usr/share/java to comply with Debian packaging guidelines
--usj-name=&lt;name&gt;: name to use when installing the library in /usr/share/java
--usj-version=&lt;version&gt;: version to use when installing the library in /usr/share/java
--no-usj-versionless: don't install the versionless link in /usr/share/java
--dest-jar=&lt;path&gt;: the destination for the real jar it will be installed with mh_install.
--classifier=&lt;classifier&gt;: Optional, the classifier for the jar. Empty by default.
--ignore-pom: don't install the POM with mh\_install or mh\_installpoms. To use with POM files that are created temporarily for certain artifacts such as Javadoc jars.
</pre>
<p>For example, debian/$package.poms could contain:</p>
<pre class="literal-block">
pom.xml --no-parent --has-package-version
module1/pom.xml --has-package-version --keep-elements=profiles,reporting // keep the profiles and reporting elements in the POM, as in this case they can be used from another place
module2/pom.xml --package=mypackage-doc // package this POM and associated items into mypackage-doc package
</pre>
<div class="section" id="mh-patchpom">
<h3>mh_patchpom:</h3>
<p>Usage:</p>
<pre class="literal-block">
mh_patchpom [option]... [pom] [backup]
</pre>
<p>Patches one POM file using the Maven dependency rules.</p>
<p>Where:</p>
<pre class="literal-block">
[pom] is the location of the POM file to transform. Default to pom.xml
[backup] is the backup file for the pom. Default to pom.xml.save
</pre>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package containing this library
-o --no-parent: don't inherit from a parent POM
-k --keep-pom-version: keep the original version of the POM but convert all other versions in dependencies and plugins.
  If there is a parent POM, keeps its version except when the parent is already registered in the Maven repository
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the POM, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
-R&lt;rule&gt;, --extra-rule=&lt;rule&gt;: additional rule to apply when cleaning the POM. May occur multiple times, instead of or in addition to -r
-u&lt;rules&gt; --published-rules=&lt;rules&gt;: path to the file containing the extra rules to publish in the property debian.mavenRules in the cleaned POM.
  Optional, the default location is debian/maven.publishedRules
-U&lt;rule&gt;, --extra-published-rule=&lt;rule&gt;: extra rule to publish. May occur multiple times, instead of or in addition to -u
-i&lt;rules&gt; --ignore-rules=&lt;rules&gt;: path to the file containing the rules used to remove certain dependencies from the cleaned POM.
  Optional, the default location is debian/maven.ignoreRules
-I&lt;rule&gt;, --extra-ignore-rule=&lt;rule&gt;: additional rule used to remove dependencies from the transformed POM May occur multiple times, instead of or in addition to -i
-c&lt;rules&gt; --clean-ignore-rules=&lt;rules&gt;: path to the file containing the rules use to remove certain dependencies from the cleaned POM, in addition to the ignore rules specified previously.
  This is useful in  situations such as when the Maven clean target requires more  dependencies or plugins to ignore than the build target.
  Optional, it is ignored by default
-s --no-rules: don't apply any rules for converting versions, do not even convert versions to the default 'debian' version
--no-publish-used-rule: don't publish the rule used to transform a POM's own attributes in debian.mavenRules
-d --debian-build: transform during a Debian build, which means that some POM elements will be removed
-b --build-no-docs: if the build doesn't need to build documentation, use this option to remove some POM elements (in particular plugins) which are useless here and may require extra dependencies and make the packaging harder.
-m&lt;repo root&gt;--maven-repo=&lt;repo root&gt;: location of the Maven repository, used to force the versions of the Maven plugins used in the current POM file with the versions found in the repository
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
</pre>
</div>
<div class="section" id="mh-patchpoms">
<h3>mh_patchpoms:</h3>
<p>Usage:</p>
<pre class="literal-block">
mh_patchpoms [option]...
</pre>
<p>Reads the file debian/$package.poms and tranform each POM file listed in
the .poms file into a POM file using the Debian versions of the
libraries. Also keeps a backup of each POM file which can be restored
with mh_unpatchpoms</p>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: package to act on
-k --keep-pom-version: keep the original version of the POM but convert all other versions in dependencies and plugins.
  If there is a parent POM, keeps its version except when the parent is already registered in the Maven repository
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the POM, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
-R&lt;rule&gt;, --extra-rule=&lt;rule&gt;: additional rule to apply when cleaning the POM. May occur multiple times, instead of or in addition to -r
-u&lt;rules&gt; --published-rules=&lt;rules&gt;: path to the file containing the extra rules to publish in the property debian.mavenRules in the cleaned POM.
  Optional, the default location is debian/maven.publishedRules
-U&lt;rule&gt;, --extra-published-rule=&lt;rule&gt;: extra rule to publish. May occur multiple times, instead of or in addition to -u
-i&lt;rules&gt; --ignore-rules=&lt;rules&gt;: path to the file containing the rules used to remove certain dependencies from the cleaned POM.
  Optional, the default location is debian/maven.ignoreRules
-I&lt;rule&gt;, --extra-ignore-rule=&lt;rule&gt;: additional rule used to remove dependencies from the transformed POM May occur multiple times, instead of or in addition to -i
-c&lt;rules&gt; --clean-ignore-rules=&lt;rules&gt;: path to the file containing the rules use to remove certain dependencies from the cleaned POM, in addition to the ignore rules specified previously.
  This is useful in  situations such as when the Maven clean target requires more  dependencies or plugins to ignore than the build target.
  Optional, it is ignored by default
-s --no-rules: don't apply any rules for converting versions, do not even convert versions to the default 'debian' version
--no-publish-used-rule: don't publish the rule used to transform a POM's own attributes in debian.mavenRules
-d --debian-build: transform during a Debian build, which means that some POM elements will be removed
-b --build-no-docs: if the build doesn't need to build documentation, use this option to remove some POM elements (in particular plugins) which are useless here and may require extra dependencies and make the packaging harder.
-m\&lt;repo root\&gt;--maven-repo=\&lt;repo root\&gt;:  location of the Maven repository, used to force the versions of the Maven plugins used in the current POM file with the versions found in the repository
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
</pre>
<p>This script is used internally by maven-repo-helper when building
packages with Maven. It is not usually used when Ant is used for the
build.
mh_unpatchpoms:
~~~~~~~~~~~~~~~~</p>
<p>Usage:</p>
<pre class="literal-block">
mh_unpatchpoms [option]...
</pre>
<p>Restore the POM files that have been patched to their original content.</p>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: package to act on
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
</pre>
</div>
</div>
<div class="section" id="working-with-jar-files">
<h2>Working with jar files:</h2>
<p>maven-repo-helper provides tools to install a freshly built jar file
into /usr/share/maven-repo, or to install a link into
/usr/share/maven-repo for a jar installed into /usr/share/java or
another location by another tool.
mh_installjar:
~~~~~~~~~~~~~~~</p>
<p>Usage:</p>
<pre class="literal-block">
mh_installjar [option]... [pom] [jar] [link]...
</pre>
<p>Installs the jar file in /usr/share/maven-repo, at the correct location
for Maven. Both the native version and the Debian version of the jar are
installed. It can also create additional links to the jar, usually
placed in /usr/share/java.</p>
<p>Where:</p>
<pre class="literal-block">
[pom] is the location of the POM associated with the jar to install.
  GroupId, artifactId and version will be extracted from this file.
[jar] is the path to the jar to install, usually located in the build
  folder.
[link] is an additional link to the jar to install, usually there should
  be a link to usr/share/java/.jar and
  usr/share/java/-.jar to comply with the Java packaging
  guidelines. Note that there is no need to specify those particular
  links if the --java-lib option is used.
</pre>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain this jar file
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the jar, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
  Maven rules are used here to extract the groupId, artifactId and version from the POM file.
-l --java-lib: Optional, if given it will install the jar into /usr/share/java to comply with the Debian Java specification.
  The jar will be installed as /usr/share/java/\$name-\$version.jar and a versionless link /usr/share/java/\$name.jar will point to it, as well as the links installed in /usr/share/maven-repo
-n&lt;name&gt; --usj-name=&lt;name&gt;: Optional, the name to use when installing the library in /usr/share/java when --java-lib is used.
  Defaults to the artifact id found in the POM.
-j&lt;version&gt; --usj-version=&lt;version&gt;: Optional, the version to use when installing the library in /usr/share/java when --java-lib is used.
  Defaults to the version found in the POM.
-s --no-usj-versionless: Optional, don't install the versionless link in /usr/share/java.
  This flag is used only when the -l or --java-lib option is given.
-d&lt;path&gt; --dest-jar=&lt;path&gt;: Optional, the destination for the real jar.
  The other places where the jar appears, in the repository or in the list of links, will be symlinks to this jar.
  Defaults  to  /usr/share/java/$name-$version.jar if --java-lib is used, otherwise the jar is installed in the versioned path in the Maven repository.
-c&lt;classifier&gt; --classifier=&lt;classifier&gt;: Optional, the classifier for the jar. Empty by default.
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
--skip-clean-pom: don't clean the pom, assume that a previous action ran mh_cleanpom with the correct options.
  mh_cleanpom is run only to extract the groupId, artifactId and version of the jar
</pre>
<div class="section" id="mh-linkjar">
<h3>mh_linkjar:</h3>
<p>Usage:</p>
<pre class="literal-block">
mh_linkjar [option]... [pom] [dest_jar] [link]...
</pre>
<p>Create symlinks for a jar installed by other means. The symlinks created
include links to the jar in /usr/share/maven-repo, at the correct
location for Maven. It can also create additional links to the jar,
usually located in /usr/share/java.</p>
<p>Where:</p>
<pre class="literal-block">
[pom] is the location of the POM associated with the jar to install.
  GroupId, artifactId and version will be extracted from this file.
[dest_jar] is the path of the installed jar, usually located in the usr/share/java folder.
[link] is an additional link to the jar to install, usually there should be a link to usr/share/java/\$jar.jar and usr/share/java/\$jar-\$version.jar to comply with the Java packaging guidelines.
  Note that there is no need to specify those particular links if the --java-lib option is used.
</pre>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain this jar file
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the jar, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
  Maven rules are used here to extract the groupId, artifactId and version from the POM file.
-l --java-lib: Optional, if given it will install the jar into /usr/share/java to comply with the Debian Java specification.
  The jar will be installed as /usr/share/java/\$name-\$version.jar and a versionless link /usr/share/java/\$name.jar will point to it, as well as the links installed in /usr/share/maven-repo
-n&lt;name&gt; --usj-name=&lt;name&gt;: Optional, the name to use when installing the library in /usr/share/java when --java-lib is used.
  Defaults to the artifact id found in the POM.
-i&lt;version&gt; --usj-version=&lt;version&gt;: Optional, the version to use when installing the library in /usr/share/java when --java-lib is used.
  Defaults to the version found in the POM.
-s --no-usj-versionless: Optional, don't install the versionless link in /usr/share/java.
  This flag is used only when the -l or --java-lib option is given.
-c&lt;classifier&gt; --classifier=&lt;classifier&gt;: Optional, the classifier for the jar. Empty by default.
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
--skip-clean-pom: don't clean the pom, assume that a previous action ran mh_cleanpom with the correct options.
  mh_cleanpom is run only to extract the groupId, artifactId and version of the jar
</pre>
</div>
<div class="section" id="mh-linkjars">
<h3>mh_linkjars:</h3>
<p>Usage:</p>
<pre class="literal-block">
mh_linkjars [option]...
</pre>
<p>Reads the file debian/$package.poms and create links for each jar file
generated by a POM listed in the .poms file.</p>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain the jar files
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the jars, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
</pre>
<p>The .poms file should contain the list of POM files associated with the
list of jars to install in the repository, and each pom file should have
either the option --usj-name, giving the name of the jar (without the
extension) to link to and located in /usr/share/java, or the option
--artifact, which should contain the full name of the source jar to link
to.</p>
<p>For example:</p>
<pre class="literal-block">
debian/pom.xml --usj-name=httpunit
</pre>
<p>or</p>
<pre class="literal-block">
debian/pom.xml --artifact=/usr/share/java/httpunit.jar
</pre>
<p>mh_linkjars is used also by jh_maven_repo_helper, the DH 7 plugin
with complements javahelper by installing the jars and the POM metadata
into the Debian Maven repository.
mh_linkrepojar:
~~~~~~~~~~~~~~~~</p>
<p>TODO</p>
</div>
</div>
<div class="section" id="working-with-the-build">
<h2>Working with the build:</h2>
<div class="section" id="mh-clean">
<h3>mh_clean:</h3>
<p>Cleans the temporary files created by the other mh_* utilities. Add it
to the clean: target in debian/rules</p>
<p>Usage:</p>
<pre class="literal-block">
mh_clean
</pre>
<p>In debian/rules, use:</p>
<pre class="literal-block">
clean::
    mh_clean
</pre>
</div>
<div class="section" id="mh-installsite">
<h3>mh_installsite:</h3>
<p>Usage:</p>
<pre class="literal-block">
mh_installsite [option]... [pom] [site-file]
</pre>
<p>Installs the site.xml file in /usr/share/maven-repo, at the correct
location for Maven.</p>
<p>Where:</p>
<pre class="literal-block">
[pom] is the location of the POM associated with the site.xml file to install.
  GroupId, artifactId and version will be extracted from this file.
[site-file] is the location of the site.xml to install.
</pre>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain the site file
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for the POM, do not use the version declared in the POM file.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM.
  Optional, the default location is debian/maven.rules
  Maven rules are used here to extract the groupId, artifactId and version from the POM file.
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
--skip-clean-pom: don't clean the pom, assume that a previous action ran mh_cleanpom with the correct options.
  mh_cleanpom is run only to extract the groupId, artifactId and version of the jar
</pre>
</div>
<div class="section" id="mh-install">
<h3>mh_install:</h3>
<p>Usage:</p>
<pre class="literal-block">
mh_install [option]...
</pre>
<p>Reads the file debian/$package.poms and installs each POM file listed in
the .poms file, as well as the associated jars - assuming that at least
the --artifact option is given in the .poms file for all jars to
install.</p>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-p&lt;package&gt; --package=&lt;package&gt;: name of the Debian package which will contain all the files to install
-e&lt;version&gt;, --set-version=&lt;version&gt;: set the version for all artifacts, do not use the version declared in the POM files.
-r&lt;rules&gt; --rules=&lt;rules&gt;: path to the file containing the rules to apply when cleaning the POM files.
  Optional, the default location is debian/maven.rules
-u&lt;rules&gt; --published-rules=&lt;rules&gt;: path to the file containing the extra rules to publish in the property debian.mavenRules in the cleaned POM.
  Optional, the default location is debian/maven.publishedRules
-i&lt;rules&gt; --ignore-rules=&lt;rules&gt;: path to the file containing the rules used to remove certain dependencies from the cleaned POM.
  Optional, the default location is debian/maven.ignoreRules
--no-publish-used-rule: don't publish the rule used to transform a POM's own attributes in debian.mavenRules
-v --verbose: show more information while running
-n --no-act: don't actually do anything, just print the results
</pre>
<p>The $package.poms file must contain enough information to locate the jar
files to install, and to associate them with their POM file. For each
POM file associated with a jar, we need to supply at least the
--artifact parameter. For example:</p>
<p>maven-debian-helper.poms:</p>
<pre class="literal-block">
pom.xml --no-parent --has-package-version
maven-debian-helper/pom.xml --has-package-version --artifact=maven-debian-helper/target/maven-debian-helper-*.jar --java-lib
maven-debian-plugin/pom.xml --has-package-version --artifact=maven-debian-plugin/target/maven-debian-plugin-*.jar --java-lib
maven-build-nodocs/pom.xml --has-package-version --artifact=maven-build-nodocs/target/maven-build-nodocs-*.jar --java-lib
maven-packager-utils/pom.xml --has-package-version --artifact=maven-packager-utils/target/maven-packager-utils-*.jar --java-lib
</pre>
<p>Here we tell mh_install to deploy the maven-debian-helper project and
its sub projects into /usr/share/maven-repo, and to deploy all jars also
into /usr/share/java (--java-lib option)</p>
<p>Internally, mh_installpom is used to install the POM file,
mh_installjar is used to install the jar if --artifact is supplied. If
a project or sub-project contains the file src/site/site.xml, then it
will be installed with mh_installsite.</p>
<p>The file $package.poms contains the list of POM files and their releated
artifacts to install. The format of the $package.poms file is:</p>
<pre class="literal-block">
&lt;path to pom file&gt; [option]*
&lt;path to second pom file&gt; [option]*
[...]
</pre>
<p>where option can be:</p>
<pre class="literal-block">
--ignore: ignore this POM and its artifact if any
--ignore-pom: don't install the POM. To use on POM files that are created
  temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms]
--no-parent: remove the &lt;parent&gt; tag from the POM
--package=&lt;package&gt;: an alternative package to use when installing this POM
   and its artifact
--has-package-version: to indicate that the original version of the POM is the same as the upstream part
   of the version for the package.
--keep-elements=&lt;elem1,elem2&gt;: a list of XML elements to keep in the POM
   during a clean operation with mh_cleanpom or mh_installpom
--artifact=&lt;path&gt;: path to the build artifact associated with this POM,
   it will be installed when using the command mh_install. [mh_install]
--java-lib: install the jar into /usr/share/java to comply with Debian
   packaging guidelines
--usj-name=&lt;name&gt;: name to use when installing the library in /usr/share/java
--usj-version=&lt;version&gt;: version to use when installing the library in /usr/share/java
--no-usj-versionless: don't install the versionless link in /usr/share/java
--dest-jar=&lt;path&gt;: the destination for the real jar.
  It will be installed with mh_install. [mh_install]
--classifier=&lt;classifier&gt;: Optional, the classifier for the jar. Empty by default.
--site-xml=&lt;location&gt;: Optional, the location for site.xml if it needs to be installed.
  Empty by default. [mh_install]
</pre>
</div>
</div>
<div class="section" id="working-with-the-repository">
<h2>Working with the repository:</h2>
<div class="section" id="mh-checkrepo">
<h3>mh_checkrepo:</h3>
<p>Checks the Maven repository for consistency and prints a report.</p>
<p>Where:</p>
<pre class="literal-block">
&lt;location&gt; is the location of the Maven repository.
Default to /usr/share/maven-repo
</pre>
<p>Options:</p>
<pre class="literal-block">
-h --help: show this text
-V --version: show the version
-v --verbose: show more information while running
-o&lt;format&gt;, --output=&lt;format&gt;: 'text' or 'html' to change output format
-r&lt;repository&gt;, --repository=&lt;repository&gt;: directory of Maven repository
</pre>
</div>
</div>
<div class="section" id="debhelper-7-plugins">
<h2>Debhelper 7 plugins:</h2>
<div class="section" id="with-maven-repo-helper">
<h3>--with maven_repo_helper:</h3>
<p>This DH 7 plugin uses the tools provided by the maven_repo_helper
package to install the project jars and POM files into
/usr/share/maven-repo. It uses the file(s) debian/$package.poms for its
configuration, as well as the files debian/maven.rules,
debian/maven.ignoreRules and debian/maven.publishedRules.</p>
<p>There can be several .poms file, one for each binary package if the
source package builds multiple binary packages, each containing its own
set of artifacts.</p>
<p>As --with maven_repo_helper plugin uses internally mh_install, the
requirements for the configuration of the .poms files are the same,
namely:</p>
<p>For each POM file associated with a jar, we need to supply at least the
--artifact parameter. For example:</p>
<p>maven-debian-helper.poms:</p>
<pre class="literal-block">
pom.xml --no-parent --has-package-version
maven-debian-helper/pom.xml --has-package-version --artifact=maven-debian-helper/target/maven-debian-helper-*.jar --java-lib
maven-debian-plugin/pom.xml --has-package-version --artifact=maven-debian-plugin/target/maven-debian-plugin-*.jar --java-lib
maven-build-nodocs/pom.xml --has-package-version --artifact=maven-build-nodocs/target/maven-build-nodocs-*.jar --java-lib
maven-packager-utils/pom.xml --has-package-version --artifact=maven-packager-utils/target/maven-packager-utils-*.jar --java-lib
</pre>
<p>To use this plugin in the rules file, all you need to do is to add those
lines to debian/rules:</p>
<pre class="literal-block">
%:
    dh $&#64; --buildsystem=ant --with maven_repo_helper
</pre>
<p>The option --buildsystem=ant is optional, and you can use any other
build system or let DH 7 detect it, and you may add additional options
to dh.
--with jh_maven_repo_helper:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
<p>This DH 7 plugin uses the tools provided by the maven_repo_helper
package to install the project jars and POM files into
/usr/share/maven-repo. It uses the file(s) debian/$package.poms for its
configuration, as well as the files debian/maven.rules,
debian/maven.ignoreRules and debian/maven.publishedRules.</p>
<p>It is designed to work alongside javahelper, and requires the use of the
javahelper plugin for DH 7 at the same time. To use this plugin in the
rules file, all you need to do is to add those lines to debian/rules:</p>
<pre class="literal-block">
%:
    dh --with javahelper --with jh_maven_repo_helper $&#64;
</pre>
<p>As for the plugin --with maven_repo_helper, you need to list the POM
files and the artifacts to install in debian/$package.poms, but this is
done in coordination with the configuration of javahelper. For example,
if the .jlibs configuration for javahelper installs the httpunit.jar
located in the lib folder into /usr/share/java,</p>
<p>libhttpunit-java.jlibs:</p>
<pre class="literal-block">
lib/httpunit.jar
</pre>
<p>Then we need to tell javahelper to install this httpunit.jar file from
/usr/share/java into the Maven repository /usr/share/maven-repo</p>
<p>libhttpunit-java.poms:</p>
<pre class="literal-block">
debian/pom.xml --usj-name=httpunit
</pre>
</div>
</div>
</div>
</div>
</body>
</html>