1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY maven-download-http "https://archive.apache.org/dist/maven/maven-3/&maven-version;/source/apache-maven-&maven-version;-src.tar.gz">
|
---|
8 | <!ENTITY maven-download-ftp " ">
|
---|
9 | <!ENTITY maven-md5sum "240b880cd7294665d7228f74f6453984">
|
---|
10 | <!ENTITY maven-size "2.6 MB">
|
---|
11 | <!ENTITY maven-buildsize "?? MB">
|
---|
12 | <!ENTITY maven-time "?? SBU">
|
---|
13 |
|
---|
14 | <!ENTITY maven-binary-http "https://archive.apache.org/dist/maven/maven-3/&maven-version;/binaries/apache-maven-&maven-version;-bin.tar.gz">
|
---|
15 | ]>
|
---|
16 |
|
---|
17 | <!-- Try to keep the indentation used in this file-->
|
---|
18 | <sect1 id="maven" xreflabel="Apache-Maven-&maven-version;">
|
---|
19 | <?dbhtml filename="maven.html"?>
|
---|
20 |
|
---|
21 | <sect1info>
|
---|
22 | <!-- this part gets updated when you commit, IFF you set the properties:
|
---|
23 | first, svn add path/to/thisfile.xml and then
|
---|
24 | svn propset svn:mime-type text/plain path/to/thisfile.xml and
|
---|
25 | svn propset svn:keywords "Date LastChangedBy" path/to/thisfile.xml -->
|
---|
26 | <othername>$LastChangedBy: pierre $</othername>
|
---|
27 | <date>$Date: 2017-09-11 12:14:03 +0200 (lun. 11 sept. 2017) $</date>
|
---|
28 | </sect1info>
|
---|
29 |
|
---|
30 | <title>Apache-Maven-&maven-version;</title>
|
---|
31 |
|
---|
32 | <indexterm zone="maven">
|
---|
33 | <primary sortas="a-maven">Apache-Maven</primary>
|
---|
34 | </indexterm>
|
---|
35 |
|
---|
36 | <sect2 role="package">
|
---|
37 | <title>Introduction to Apache-Maven</title>
|
---|
38 |
|
---|
39 | <para>
|
---|
40 | <application>Apache-Maven</application> is a tool that can be used for
|
---|
41 | building and managing any Java-based project. Based on the concept of a
|
---|
42 | project object model (POM), <application>Apache-Maven</application> can
|
---|
43 | manage a project's build, reporting and documentation from a central
|
---|
44 | piece of information.
|
---|
45 | </para>
|
---|
46 |
|
---|
47 | &lfs82_checked;
|
---|
48 |
|
---|
49 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
50 | <itemizedlist spacing="compact">
|
---|
51 | <listitem>
|
---|
52 | <para>
|
---|
53 | Download (HTTP): <ulink url="&maven-download-http;"/>
|
---|
54 | </para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>
|
---|
58 | Download (FTP): <ulink url="&maven-download-ftp;"/>
|
---|
59 | </para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>
|
---|
63 | Download MD5 sum: &maven-md5sum;
|
---|
64 | </para>
|
---|
65 | </listitem>
|
---|
66 | <listitem>
|
---|
67 | <para>
|
---|
68 | Download size: &maven-size;
|
---|
69 | </para>
|
---|
70 | </listitem>
|
---|
71 | <listitem>
|
---|
72 | <para>
|
---|
73 | Estimated disk space required: &maven-buildsize;
|
---|
74 | </para>
|
---|
75 | </listitem>
|
---|
76 | <listitem>
|
---|
77 | <para>
|
---|
78 | Estimated build time: &maven-time;
|
---|
79 | </para>
|
---|
80 | </listitem>
|
---|
81 | </itemizedlist>
|
---|
82 |
|
---|
83 |
|
---|
84 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
85 | <itemizedlist spacing="compact">
|
---|
86 | <listitem>
|
---|
87 | <para>
|
---|
88 | <application>Appache-Maven</application> needs to be built with
|
---|
89 | itself, so a binary is needed:
|
---|
90 | <ulink url="&maven-binary-http;"/>
|
---|
91 | </para>
|
---|
92 | </listitem>
|
---|
93 | </itemizedlist>
|
---|
94 |
|
---|
95 |
|
---|
96 | <bridgehead renderas="sect3">Apache-Maven Dependencies</bridgehead>
|
---|
97 |
|
---|
98 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
99 | <para role="required">
|
---|
100 | A JDK (<xref linkend="java-bin"/> or <xref linkend="openjdk"/>)
|
---|
101 | </para>
|
---|
102 |
|
---|
103 | <para condition="html" role="usernotes">
|
---|
104 | User Notes: <ulink url="&blfs-wiki;/ApacheMaven"/>
|
---|
105 | </para>
|
---|
106 | </sect2>
|
---|
107 |
|
---|
108 | <sect2 role="installation">
|
---|
109 | <title>Installation of Apache-Maven</title>
|
---|
110 |
|
---|
111 | <para>
|
---|
112 | Install <application>Apache-Maven</application> by running the following
|
---|
113 | commands:
|
---|
114 | </para>
|
---|
115 |
|
---|
116 | <screen><userinput>install -vdm 755 ../apache-maven-bin &&
|
---|
117 | tar -xf ../apache-maven-&maven-version;-bin.tar.gz \
|
---|
118 | --strip-components=1 \
|
---|
119 | --directory ../apache-maven-bin &&
|
---|
120 |
|
---|
121 | SAVEPATH=$PATH &&
|
---|
122 | PATH=../apache-maven-bin/bin:$PATH &&
|
---|
123 |
|
---|
124 | mvn -DdistributionTargetDir=build \
|
---|
125 | package</userinput></screen>
|
---|
126 |
|
---|
127 | <para>
|
---|
128 | The test are run as part of the compilation above.
|
---|
129 | </para>
|
---|
130 |
|
---|
131 | <para>
|
---|
132 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
133 | </para>
|
---|
134 |
|
---|
135 | <screen role="root"><userinput>install -vdm 755 /opt/maven-&maven-version; &&
|
---|
136 | cp -Rv apache-maven/build/* /opt/maven-&maven-version; &&
|
---|
137 | ln -sfvn maven-&maven-version; /opt/maven</userinput></screen>
|
---|
138 |
|
---|
139 | <para>
|
---|
140 | You can know reset the <envar>PATH</envar> variable and clean
|
---|
141 | the source directory:
|
---|
142 | </para>
|
---|
143 |
|
---|
144 | <screen><userinput>PATH=$SAVEPATH &&
|
---|
145 | rm -rf ../apache-maven-bin</userinput></screen>
|
---|
146 |
|
---|
147 | </sect2>
|
---|
148 |
|
---|
149 | <sect2 role="commands">
|
---|
150 | <title>Command Explanations</title>
|
---|
151 |
|
---|
152 | <para>
|
---|
153 | <command>tar ../apache-maven-&maven-version;-bin.tar.gz ...
|
---|
154 | PATH=.../bin:$PATH</command>: Extracts the
|
---|
155 | <application>Apache-Maven</application> binary and let the system know
|
---|
156 | about the binary location.
|
---|
157 | </para>
|
---|
158 |
|
---|
159 | <para>
|
---|
160 | <command>mvn ... package</command>: Compiles and tests the package, and
|
---|
161 | packages it to its final format.
|
---|
162 | </para>
|
---|
163 |
|
---|
164 | <para>
|
---|
165 | <parameter>-DdistributionTargetDir=build</parameter>: Specifies
|
---|
166 | the location where the built binary should be packaged. The content of
|
---|
167 | this directory is ready to be copied to its final location.
|
---|
168 | </para>
|
---|
169 |
|
---|
170 | <para>
|
---|
171 | <command>ln -sfvn maven-&maven-version; /opt/maven</command>: Creates
|
---|
172 | a convenience symlink.
|
---|
173 | </para>
|
---|
174 |
|
---|
175 | <para>
|
---|
176 | <option>-Dmaven.repo.local=...</option>: Specifies a maven local
|
---|
177 | repository for this build, instead of the default <filename
|
---|
178 | class="directory">~/.m2/repository</filename>. You may want to use this
|
---|
179 | if several users are to use <application>Apache-Maven</application>.
|
---|
180 | </para>
|
---|
181 |
|
---|
182 | </sect2>
|
---|
183 |
|
---|
184 | <sect2 role="configuration">
|
---|
185 | <title>Configuring Apache-Maven</title>
|
---|
186 |
|
---|
187 | <sect3 id="maven-config">
|
---|
188 | <title>Config Files</title>
|
---|
189 | <para>
|
---|
190 | The user settings file <filename>~/.m2/settings.xml</filename> and
|
---|
191 | the global settings file
|
---|
192 | <filename>/opt/maven/conf/settings.xml</filename>
|
---|
193 | </para>
|
---|
194 |
|
---|
195 | <indexterm zone="maven maven-config">
|
---|
196 | <primary sortas="e-AA.m2-settings.xml">~/.m2-settings.xml</primary>
|
---|
197 | </indexterm>
|
---|
198 |
|
---|
199 | <indexterm zone="maven maven-config">
|
---|
200 | <primary
|
---|
201 | sortas="e-opt-maven-conf-settings.xml">/opt/maven/conf/settings.xml</primary>
|
---|
202 | </indexterm>
|
---|
203 | </sect3>
|
---|
204 |
|
---|
205 | <sect3><title>Configuration Information</title>
|
---|
206 |
|
---|
207 | <para>
|
---|
208 | The default configuration file shipped with
|
---|
209 | <application>Apache-Maven</application> should be sufficent for
|
---|
210 | common tasks. You may want to copy the global settings file to
|
---|
211 | your user one and modify it to suit your needs.
|
---|
212 | </para>
|
---|
213 |
|
---|
214 | <para>
|
---|
215 | You should add the <command>mvn</command> command to
|
---|
216 | <envar>PATH</envar>. For example:
|
---|
217 | </para>
|
---|
218 |
|
---|
219 | <screen role="root"><userinput>cat > /etc/profile.d/maven.sh << "EOF"
|
---|
220 | <literal># Begin /etc/profile.d/maven.sh
|
---|
221 |
|
---|
222 | pathappend /opt/maven/bin
|
---|
223 |
|
---|
224 | # End /etc/profile.d/maven.sh</literal>
|
---|
225 | EOF</userinput></screen>
|
---|
226 |
|
---|
227 | </sect3>
|
---|
228 |
|
---|
229 | </sect2>
|
---|
230 |
|
---|
231 | <sect2 role="content">
|
---|
232 | <title>Contents</title>
|
---|
233 |
|
---|
234 | <segmentedlist>
|
---|
235 | <segtitle>Installed Program(s)</segtitle>
|
---|
236 | <segtitle>Installed Librar(y,ies)</segtitle>
|
---|
237 | <segtitle>Installed Director(y,ies)</segtitle>
|
---|
238 |
|
---|
239 | <seglistitem>
|
---|
240 | <seg>
|
---|
241 | mvn, mvnDebug, and mvnyjp
|
---|
242 | </seg>
|
---|
243 | <seg>
|
---|
244 | libjansi.so in /opt/maven/lib/jansi-native
|
---|
245 | </seg>
|
---|
246 | <seg>
|
---|
247 | /opt/maven-&maven-version;
|
---|
248 | </seg>
|
---|
249 | </seglistitem>
|
---|
250 | </segmentedlist>
|
---|
251 |
|
---|
252 | <variablelist>
|
---|
253 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
254 | <?dbfo list-presentation="list"?>
|
---|
255 | <?dbhtml list-presentation="table"?>
|
---|
256 |
|
---|
257 | <varlistentry id="mvn">
|
---|
258 | <term><command>mvn</command></term>
|
---|
259 | <listitem>
|
---|
260 | <para>
|
---|
261 | is the <application>Apache-Maven</application> Java-based project
|
---|
262 | builder and manager
|
---|
263 | </para>
|
---|
264 | <indexterm zone="maven mvn">
|
---|
265 | <primary sortas="b-mvn">mvn</primary>
|
---|
266 | </indexterm>
|
---|
267 | </listitem>
|
---|
268 | </varlistentry>
|
---|
269 |
|
---|
270 | <varlistentry id="mvnDebug">
|
---|
271 | <term><command>mvnDebug</command></term>
|
---|
272 | <listitem>
|
---|
273 | <para>
|
---|
274 | turns on <command>mvn</command> debug mode
|
---|
275 | </para>
|
---|
276 | <indexterm zone="maven mvnDebug">
|
---|
277 | <primary sortas="b-mvnDebug">mvnDebug</primary>
|
---|
278 | </indexterm>
|
---|
279 | </listitem>
|
---|
280 | </varlistentry>
|
---|
281 |
|
---|
282 | <varlistentry id="mvnyjp">
|
---|
283 | <term><command>mvnyjp</command></term>
|
---|
284 | <listitem>
|
---|
285 | <para>
|
---|
286 | runs <command>mvn</command>under the supervision of the
|
---|
287 | <ulink url="https://www.yourkit.com/java/profiler/">YourKit Java
|
---|
288 | Profiler</ulink>
|
---|
289 | </para>
|
---|
290 | <indexterm zone="maven mvnyjp">
|
---|
291 | <primary sortas="b-mvnyjp">mvnyjp</primary>
|
---|
292 | </indexterm>
|
---|
293 | </listitem>
|
---|
294 | </varlistentry>
|
---|
295 |
|
---|
296 | </variablelist>
|
---|
297 | </sect2>
|
---|
298 | </sect1>
|
---|