Author: pierre Date: Mon Mar 19 14:22:16 2018 New Revision: 19974 Log: Add apache-maven and update to junit-4.12
Added: trunk/BOOK/general/prog/maven.xml Modified: trunk/BOOK/general/prog/junit.xml trunk/BOOK/general/prog/prog.xml trunk/BOOK/introduction/welcome/changelog.xml trunk/BOOK/packages.ent trunk/BOOK/pst/ps/fop.xml Modified: trunk/BOOK/general/prog/junit.xml ============================================================================== --- trunk/BOOK/general/prog/junit.xml Mon Mar 19 14:09:55 2018 (r19973) +++ trunk/BOOK/general/prog/junit.xml Mon Mar 19 14:22:16 2018 (r19974) @@ -4,12 +4,12 @@ <!ENTITY % general-entities SYSTEM "../../general.ent"> %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)"> ]> <sect1 id="junit" xreflabel="JUnit-&junit-version;"> @@ -60,7 +60,7 @@ <para>Estimated build time: &junit-time;</para> </listitem> </itemizedlist> - +<!-- maven downloads this for us: <bridgehead renderas="sect3">Additional Downloads</bridgehead> <itemizedlist spacing="compact"> <listitem> @@ -76,12 +76,12 @@ </para> </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> @@ -92,49 +92,46 @@ <sect2 role="installation"> <title>Installation of JUnit</title> - <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: + First remove a test, which fails with <application>Java 9</application>. </para> -<screen><userinput>sed -i '\@/docs/@a<arg value="-Xdoclint:none"/>' build.xml</userinput></screen> +<screen><userinput>sed -e '/MethodsSorted/i @Ignore' \ + -i src/test/java/org/junit/runners/model/TestClassTest.java</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: + Install <application>Junit</application> by running the following + commands: </para> -<screen><userinput>sed -i 's/1\.5/1.8/' build.xml</userinput></screen> +<screen><userinput>mvn -DjdkVersion=1.6 install</userinput></screen> <para> - Now place the required hamcrest jar files where needed and build the - package: + The tests are run as part of the command above. </para> -<screen><userinput>cp -v ../hamcrest-core-&hamcrest-version;{,-sources}.jar lib/ && -ant populate-dist</userinput></screen> - <para> - Test the package by issuing <command>ant dist</command>. One test fails - for unknown reason. + If you wish to generate the documentation, issue: </para> +<screen><userinput>mvn site</userinput></screen> + <para> Install the files in the final location as the <systemitem class="username">root</systemitem> user: </para> -<screen role="root"><userinput>install -v -m755 -d /usr/share/{doc,java}/junit-&junit-version; && -chown -R root:root . && +<screen role="root"><userinput>install -v -m755 -d /usr/share/java/junit-&junit-version; && +cp -v target/junit-&junit-version;.jar /usr/share/java/junit-&junit-version; && +cp -v lib/hamcrest-core-1.3.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; && +cp -v -R target/site/* /usr/share/doc/junit-&junit-version;</userinput></screen> -cp -v -R junit*/javadoc/* /usr/share/doc/junit-&junit-version; && -cp -v junit*/junit*.jar /usr/share/java/junit-&junit-version;</userinput></screen> <para> If you have followed the instructions in <xref linkend="ojdk-conf"/>, @@ -166,7 +163,7 @@ <?dbhtml list-presentation="table"?> <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 architecture.</para> @@ -175,6 +172,17 @@ </indexterm> </listitem> </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> Added: trunk/BOOK/general/prog/maven.xml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/BOOK/general/prog/maven.xml Mon Mar 19 14:22:16 2018 (r19974) @@ -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 && +tar -xf ../apache-maven-&maven-version;-bin.tar.gz \ + --strip-components=1 \ + --directory ../apache-maven-bin && + +SAVEPATH=$PATH && +PATH=../apache-maven-bin/bin:$PATH && + +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; && +cp -Rv apache-maven/build/* /opt/maven-&maven-version; && +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 && +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 > /etc/profile.d/maven.sh << "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> Modified: trunk/BOOK/general/prog/prog.xml ============================================================================== --- trunk/BOOK/general/prog/prog.xml Mon Mar 19 14:09:55 2018 (r19973) +++ trunk/BOOK/general/prog/prog.xml Mon Mar 19 14:22:16 2018 (r19974) @@ -70,6 +70,7 @@ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="java.xml"/> <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"/> Modified: trunk/BOOK/introduction/welcome/changelog.xml ============================================================================== --- trunk/BOOK/introduction/welcome/changelog.xml Mon Mar 19 14:09:55 2018 (r19973) +++ trunk/BOOK/introduction/welcome/changelog.xml Mon Mar 19 14:22:16 2018 (r19974) @@ -45,6 +45,14 @@ <para>March 19th, 2018</para> <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> </listitem> Modified: trunk/BOOK/packages.ent ============================================================================== --- trunk/BOOK/packages.ent Mon Mar 19 14:09:55 2018 (r19973) +++ trunk/BOOK/packages.ent Mon Mar 19 14:22:16 2018 (r19974) @@ -345,7 +345,9 @@ <!ENTITY yasm-version "1.3.0"> <!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"> <!ENTITY openjdk-build "11"> Modified: trunk/BOOK/pst/ps/fop.xml ============================================================================== --- trunk/BOOK/pst/ps/fop.xml Mon Mar 19 14:09:55 2018 (r19973) +++ trunk/BOOK/pst/ps/fop.xml Mon Mar 19 14:22:16 2018 (r19974) @@ -102,7 +102,7 @@ <para role="optional"> <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> <!-- [pierre 2017-04-29] Note to devs: there are a lot of bundled dependencies. -- http://lists.linuxfromscratch.org/listinfo/blfs-book FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page