forked from fedora-java/howto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
maven.txt
56 lines (41 loc) · 1.45 KB
/
maven.txt
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
[quote,,http://maven.apache.org]
______
Apache Maven is a software project management and comprehension tool. Based on
the concept of a project object model (POM), Maven can manage a project's build,
reporting and documentation from a central piece of information.
______
Maven is by far the most consistent Java build system, allowing large amount of
automation. In most common situations only following steps are necessary:
1. In `%build` section of the spec file use `%mvn_build` macro
2. In `%install` section, use `%mvn_install` macro
3. Use generated file `.mfiles` lists to populate `%files` section with `-f` switch
.Common spec file sections
[source,spec]
--------
BuildRequires: maven-local
...
%build
%mvn_build
...
%install
%mvn_install
...
%files -f .mfiles
%dir %{_javadir}/%{name}
%files javadoc -f .mfiles-javadoc
-------
The macros `%mvn_build` and `%mvn_install` automatically handle building of the
JAR files and their subsequent installation to the correct directory. The
corresponding POM and metadata files are also installed.
[[packaging_maven_project]]
=== Packaging Maven project
include::packaging_maven_project.txt[]
[[mvn_macros]]
=== Macros for Maven build configuration
Maven builds can be configured to produce alternative layout, include additional
aliases in package metadata or create separate subpackages for certain
artifacts.
include::mvn_macros.txt[]
[[helper_macros]]
=== Macros for POM modification
include::pom_macros.txt[]