Index: general/prog/junit.xml
===================================================================
--- general/prog/junit.xml	(revision 7fc15d9aa1c9864176d3a354c95e9b22a2206252)
+++ general/prog/junit.xml	(revision cb7032fee90d6d5fd01e4fe8e5e530e29e7833f0)
@@ -5,10 +5,10 @@
   %general-entities;
 
-  <!ENTITY junit-download-http "https://launchpad.net/debian/+archive/primary/+files/junit4_&junit-version;.orig.tar.gz">
+  <!ENTITY junit-download-http "https://github.com/junit-team/junit&junit-major;/archive/r&junit-version;/junit-&junit-version;.tar.gz">
   <!ENTITY junit-download-ftp  " ">
-  <!ENTITY junit-md5sum        "b4d163832583dcec8bedb5427c795cc4">
-  <!ENTITY junit-size          "1.7 MB">
-  <!ENTITY junit-buildsize     "34 MB">
-  <!ENTITY junit-time          "0.1 SBU">
+  <!ENTITY junit-md5sum        "22578a9b35cbb71d556a2e625c576c81">
+  <!ENTITY junit-size          "433 KB">
+  <!ENTITY junit-buildsize     "27 MB">
+  <!ENTITY junit-time          "0.2 SBU (with dicumentation, using 4 cores; add maven <quote>crates</quote> download time)">
 ]>
 
@@ -61,5 +61,5 @@
       </listitem>
     </itemizedlist>
-
+<!-- maven downloads this for us:
     <bridgehead renderas="sect3">Additional Downloads</bridgehead>
     <itemizedlist spacing="compact">
@@ -77,10 +77,10 @@
       </listitem>
     </itemizedlist>
-
+-->
     <bridgehead renderas="sect3">JUnit Dependencies</bridgehead>
 
     <bridgehead renderas="sect4">Required</bridgehead>
     <para role="required">
-      <xref linkend="apache-ant"/> and
+      <xref linkend="maven"/> and
       <xref linkend="unzip"/>
     </para>
@@ -93,36 +93,27 @@
   <sect2 role="installation">
     <title>Installation of JUnit</title>
+    <para>
+      First remove a test, which fails with <application>Java 9</application>.
+    </para>
+
+<screen><userinput>sed -e '/MethodsSorted/i    @Ignore' \
+    -i src/test/java/org/junit/runners/model/TestClassTest.java</userinput></screen>
 
     <para>
-      The <command>javadoc</command> command coming with OpenJDK 8 has become
-      much stricter than before regarding the conformance of the Javadoc
-      comments in source code to HTML. The <application>Junit</application>
-      documentation does not meet that standard, so the conformance checks
-      have to be disabled. This can be done with the following command:
+      Install <application>Junit</application> by running the following
+      commands:
     </para>
 
-<screen><userinput>sed -i '\@/docs/@a&lt;arg value="-Xdoclint:none"/&gt;' build.xml</userinput></screen>
+<screen><userinput>mvn -DjdkVersion=1.6 install</userinput></screen>
 
     <para>
-      With <application>Java 9</application>, the minimum accepted code version
-      is 1.6. However, the build system passes <option>-source 1.5</option>,
-      while the junit code can perfectly be compiled for a Java 8 JVM. Change
-      that by issuing the following command:
+      The tests are run as part of the command above.
     </para>
 
-<screen><userinput>sed -i 's/1\.5/1.8/' build.xml</userinput></screen>
-
     <para>
-      Now place the required hamcrest jar files where needed and build the
-      package:
+      If you wish to generate the documentation, issue:
     </para>
 
-<screen><userinput>cp -v ../hamcrest-core-&hamcrest-version;{,-sources}.jar lib/ &amp;&amp;
-ant populate-dist</userinput></screen>
-
-    <para>
-      Test the package by issuing <command>ant dist</command>. One test fails
-      for unknown reason.
-    </para>
+<screen><userinput>mvn site</userinput></screen>
 
     <para>
@@ -131,9 +122,15 @@
     </para>
 
-<screen role="root"><userinput>install -v -m755 -d /usr/share/{doc,java}/junit-&junit-version; &amp;&amp;
-chown -R root:root .                                 &amp;&amp;
+<screen role="root"><userinput>install -v -m755 -d             /usr/share/java/junit-&junit-version; &amp;&amp;
+cp -v target/junit-&junit-version;.jar     /usr/share/java/junit-&junit-version; &amp;&amp;
+cp -v lib/hamcrest-core-1.3.jar /usr/share/java/junit-&junit-version;</userinput></screen>
 
-cp -v -R junit*/javadoc/*             /usr/share/doc/junit-&junit-version;  &amp;&amp;
-cp -v junit*/junit*.jar               /usr/share/java/junit-&junit-version;</userinput></screen>
+    <para>
+      if the documentation was built, install it as the
+      <systemitem class="username">root</systemitem> user:
+    </para>
+<screen role="root"><userinput>install -v -m755 -d    /usr/share/doc/junit-&junit-version; &amp;&amp;
+cp -v -R target/site/* /usr/share/doc/junit-&junit-version;</userinput></screen>
+
 
     <para>
@@ -167,5 +164,5 @@
 
       <varlistentry id="junit.jar">
-        <term><filename class='libraryfile'>junit jar files</filename></term>
+        <term><filename class='libraryfile'>junit-&junit-version;.jar</filename></term>
         <listitem>
           <para>contains java classes to support the xUnit framework testing
@@ -177,4 +174,15 @@
       </varlistentry>
 
+      <varlistentry id="hamcrest-core">
+        <term><filename class='libraryfile'>hamcrest-core-1.3.jar</filename></term>
+        <listitem>
+          <para>contains java classes to support matchers used in xUnit
+          tests.</para>
+          <indexterm zone="junit hamcrest-core">
+            <primary sortas="c-hamcrest-core">hamcrest-core-1.3.jar</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
     </variablelist>
 
Index: general/prog/maven.xml
===================================================================
--- general/prog/maven.xml	(revision cb7032fee90d6d5fd01e4fe8e5e530e29e7833f0)
+++ general/prog/maven.xml	(revision cb7032fee90d6d5fd01e4fe8e5e530e29e7833f0)
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../../general.ent">
+  %general-entities;
+
+  <!ENTITY maven-download-http "https://archive.apache.org/dist/maven/maven-3/&maven-version;/source/apache-maven-&maven-version;-src.tar.gz">
+  <!ENTITY maven-download-ftp  " ">
+  <!ENTITY maven-md5sum        "240b880cd7294665d7228f74f6453984">
+  <!ENTITY maven-size          "2.6 MB">
+  <!ENTITY maven-buildsize     "?? MB">
+  <!ENTITY maven-time          "?? SBU">
+
+  <!ENTITY maven-binary-http "https://archive.apache.org/dist/maven/maven-3/&maven-version;/binaries/apache-maven-&maven-version;-bin.tar.gz">
+]>
+
+<!-- Try to keep the indentation used in this file-->
+<sect1 id="maven" xreflabel="Apache-Maven-&maven-version;">
+  <?dbhtml filename="maven.html"?>
+
+  <sect1info>
+    <!-- this part gets updated when you commit, IFF you set the properties:
+      first, svn add path/to/thisfile.xml and then
+      svn propset svn:mime-type text/plain path/to/thisfile.xml and
+      svn propset svn:keywords "Date LastChangedBy" path/to/thisfile.xml -->
+    <othername>$LastChangedBy: pierre $</othername>
+    <date>$Date: 2017-09-11 12:14:03 +0200 (lun. 11 sept. 2017) $</date>
+  </sect1info>
+
+  <title>Apache-Maven-&maven-version;</title>
+
+  <indexterm zone="maven">
+    <primary sortas="a-maven">Apache-Maven</primary>
+  </indexterm>
+
+  <sect2 role="package">
+    <title>Introduction to Apache-Maven</title>
+
+    <para>
+      <application>Apache-Maven</application> is a tool that can be used for
+      building and managing any Java-based project. Based on the concept of a
+      project object model (POM), <application>Apache-Maven</application> can
+      manage a project's build, reporting and documentation from a central
+      piece of information.
+    </para>
+
+    &lfs82_checked;
+
+    <bridgehead renderas="sect3">Package Information</bridgehead>
+    <itemizedlist spacing="compact">
+      <listitem>
+        <para>
+          Download (HTTP): <ulink url="&maven-download-http;"/>
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Download (FTP): <ulink url="&maven-download-ftp;"/>
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Download MD5 sum: &maven-md5sum;
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Download size: &maven-size;
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Estimated disk space required: &maven-buildsize;
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Estimated build time: &maven-time;
+        </para>
+      </listitem>
+    </itemizedlist>
+
+
+    <bridgehead renderas="sect3">Additional Downloads</bridgehead>
+    <itemizedlist spacing="compact">
+      <listitem>
+        <para>
+          <application>Appache-Maven</application> needs to be built with
+          itself, so a binary is needed:
+          <ulink url="&maven-binary-http;"/>
+        </para>
+      </listitem>
+    </itemizedlist>
+
+
+    <bridgehead renderas="sect3">Apache-Maven Dependencies</bridgehead>
+
+    <bridgehead renderas="sect4">Required</bridgehead>
+    <para role="required">
+      A JDK (<xref linkend="java-bin"/> or <xref linkend="openjdk"/>)
+    </para>
+
+    <para condition="html" role="usernotes">
+      User Notes: <ulink url="&blfs-wiki;/ApacheMaven"/>
+    </para>
+  </sect2>
+
+  <sect2 role="installation">
+    <title>Installation of Apache-Maven</title>
+
+    <para>
+      Install <application>Apache-Maven</application> by running the following
+      commands:
+    </para>
+
+<screen><userinput>install -vdm 755 ../apache-maven-bin     &amp;&amp;
+tar -xf ../apache-maven-&maven-version;-bin.tar.gz \
+    --strip-components=1                 \
+    --directory ../apache-maven-bin      &amp;&amp;
+
+SAVEPATH=$PATH   &amp;&amp;
+PATH=../apache-maven-bin/bin:$PATH &amp;&amp;
+
+mvn -DdistributionTargetDir=build \
+    package</userinput></screen>
+
+    <para>
+      The test are run as part of the compilation above.
+    </para>
+
+    <para>
+      Now, as the <systemitem class="username">root</systemitem> user:
+    </para>
+
+<screen role="root"><userinput>install -vdm 755            /opt/maven-&maven-version; &amp;&amp;
+cp -Rv apache-maven/build/* /opt/maven-&maven-version; &amp;&amp;
+ln -sfvn maven-&maven-version; /opt/maven</userinput></screen>
+
+    <para>
+      You can know reset the <envar>PATH</envar> variable and clean
+      the source directory:
+    </para>
+
+<screen><userinput>PATH=$SAVEPATH &amp;&amp;
+rm -rf ../apache-maven-bin</userinput></screen>
+
+  </sect2>
+
+  <sect2 role="commands">
+    <title>Command Explanations</title>
+
+    <para>
+      <command>tar ../apache-maven-&maven-version;-bin.tar.gz ...
+               PATH=.../bin:$PATH</command>: Extracts the
+      <application>Apache-Maven</application> binary and let the system know
+      about the binary location.
+    </para>
+
+    <para>
+      <command>mvn ... package</command>: Compiles and tests the package, and
+      packages it to its final format.
+    </para>
+
+    <para>
+      <parameter>-DdistributionTargetDir=build</parameter>: Specifies
+      the location where the built binary should be packaged. The content of
+      this directory is ready to be copied to its final location.
+    </para>
+
+    <para>
+      <command>ln -sfvn maven-&maven-version; /opt/maven</command>: Creates
+      a convenience symlink.
+    </para>
+
+    <para>
+      <option>-Dmaven.repo.local=...</option>: Specifies a maven local
+      repository for this build, instead of the default <filename
+      class="directory">~/.m2/repository</filename>. You may want to use this
+      if several users are to use <application>Apache-Maven</application>.
+    </para>
+
+  </sect2>
+
+  <sect2 role="configuration">
+    <title>Configuring Apache-Maven</title>
+
+    <sect3 id="maven-config">
+      <title>Config Files</title>
+      <para>
+        The user settings file <filename>~/.m2/settings.xml</filename> and
+        the global settings file
+        <filename>/opt/maven/conf/settings.xml</filename>
+      </para>
+
+      <indexterm zone="maven maven-config">
+        <primary sortas="e-AA.m2-settings.xml">~/.m2-settings.xml</primary>
+      </indexterm>
+
+      <indexterm zone="maven maven-config">
+        <primary
+        sortas="e-opt-maven-conf-settings.xml">/opt/maven/conf/settings.xml</primary>
+      </indexterm>
+    </sect3>
+
+    <sect3><title>Configuration Information</title>
+
+      <para>
+        The default configuration file shipped with
+        <application>Apache-Maven</application> should be sufficent for
+        common tasks. You may want to copy the global settings file to
+        your user one and modify it to suit your needs.
+      </para>
+
+      <para>
+        You should add the <command>mvn</command> command to
+        <envar>PATH</envar>. For example:
+      </para>
+
+<screen role="root"><userinput>cat &gt; /etc/profile.d/maven.sh &lt;&lt; "EOF"
+<literal># Begin /etc/profile.d/maven.sh
+
+pathappend /opt/maven/bin
+
+# End /etc/profile.d/maven.sh</literal>
+EOF</userinput></screen>
+
+    </sect3>
+
+  </sect2>
+
+  <sect2 role="content">
+    <title>Contents</title>
+
+    <segmentedlist>
+      <segtitle>Installed Program(s)</segtitle>
+      <segtitle>Installed Librar(y,ies)</segtitle>
+      <segtitle>Installed Director(y,ies)</segtitle>
+
+      <seglistitem>
+        <seg>
+          mvn, mvnDebug, and mvnyjp
+        </seg>
+        <seg>
+          libjansi.so in /opt/maven/lib/jansi-native
+        </seg>
+        <seg>
+          /opt/maven-&maven-version;
+        </seg>
+      </seglistitem>
+    </segmentedlist>
+
+    <variablelist>
+      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+      <?dbfo list-presentation="list"?>
+      <?dbhtml list-presentation="table"?>
+
+      <varlistentry id="mvn">
+        <term><command>mvn</command></term>
+        <listitem>
+          <para>
+            is the <application>Apache-Maven</application> Java-based project
+            builder and manager
+          </para>
+          <indexterm zone="maven mvn">
+            <primary sortas="b-mvn">mvn</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="mvnDebug">
+        <term><command>mvnDebug</command></term>
+        <listitem>
+          <para>
+            turns on <command>mvn</command> debug mode
+          </para>
+          <indexterm zone="maven mvnDebug">
+            <primary sortas="b-mvnDebug">mvnDebug</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="mvnyjp">
+        <term><command>mvnyjp</command></term>
+        <listitem>
+          <para>
+            runs <command>mvn</command>under the supervision of the
+            <ulink url="https://www.yourkit.com/java/profiler/">YourKit Java
+            Profiler</ulink>
+          </para>
+          <indexterm zone="maven mvnyjp">
+            <primary sortas="b-mvnyjp">mvnyjp</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+  </sect2>
+</sect1>
Index: general/prog/prog.xml
===================================================================
--- general/prog/prog.xml	(revision 7fc15d9aa1c9864176d3a354c95e9b22a2206252)
+++ general/prog/prog.xml	(revision cb7032fee90d6d5fd01e4fe8e5e530e29e7833f0)
@@ -71,4 +71,5 @@
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="openjdk.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ojdk-conf.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="maven.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apache-ant.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="junit.xml"/>
Index: introduction/welcome/changelog.xml
===================================================================
--- introduction/welcome/changelog.xml	(revision 7fc15d9aa1c9864176d3a354c95e9b22a2206252)
+++ introduction/welcome/changelog.xml	(revision cb7032fee90d6d5fd01e4fe8e5e530e29e7833f0)
@@ -46,4 +46,12 @@
       <itemizedlist>
         <listitem>
+          <para>[pierre] - Update to Junit-4.12 (using maven for building).
+          Fixes <ulink url="&blfs-ticket-root;10422">#10422</ulink>.</para>
+        </listitem>
+        <listitem>
+          <para>[pierre] - Add Apache-Maven-3.5.3. Part of
+          <ulink url="&blfs-ticket-root;10422">#10422</ulink>.</para>
+        </listitem>
+        <listitem>
           <para>[ken] - Update to firefox-59.0.1 (security fix). Fixes
           <ulink url="&blfs-ticket-root;10557">#10557</ulink>.</para>
Index: packages.ent
===================================================================
--- packages.ent	(revision 7fc15d9aa1c9864176d3a354c95e9b22a2206252)
+++ packages.ent	(revision cb7032fee90d6d5fd01e4fe8e5e530e29e7833f0)
@@ -346,5 +346,7 @@
 
 <!ENTITY apache-ant-version           "1.10.2">
-<!ENTITY junit-version                "4.11">
+<!ENTITY maven-version                "3.5.3">
+<!ENTITY junit-major                  "4">
+<!ENTITY junit-version                "4.12">
 <!ENTITY hamcrest-version             "1.3">
 <!ENTITY openjdk-version              "9.0.4">
Index: pst/ps/fop.xml
===================================================================
--- pst/ps/fop.xml	(revision 7fc15d9aa1c9864176d3a354c95e9b22a2206252)
+++ pst/ps/fop.xml	(revision cb7032fee90d6d5fd01e4fe8e5e530e29e7833f0)
@@ -103,5 +103,5 @@
       <xref linkend="junit"/> (to run tests),
       <xref linkend="x-window-system"/> (to run tests),
-      <ulink url="https://maven.apache.org/">Maven</ulink>,
+      <xref linkend="maven"/> (an alternate build system),
       <ulink url="https://java.net/projects/jai-imageio">JAI Image I/O Tools</ulink>, and
       <ulink url="http://jeuclid.sourceforge.net/">JEuclid</ulink>
