-
Notifications
You must be signed in to change notification settings - Fork 265
/
faq.fml
116 lines (112 loc) · 4.58 KB
/
faq.fml
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
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<faqs id="FAQ" title="Frequently Asked Questions">
<part id="general">
<title>General</title>
<faq id="versions">
<question>What does the Versions Maven Plugin do?</question>
<answer>
<p>The Versions Maven Plugin provides a means to update version information in a Maven project</p>
</answer>
</faq>
<faq id="comparisonMethod">
<question>Why is this plugin reporting version 1.0.0.9 of foo:bar as the latest version when I can see
version 1.0.0.23?
</question>
<answer>
<p>The current implementation of
<a href="http://maven.apache.org/ref/current/maven-artifact/xref/org/apache/maven/artifact/versioning/DefaultArtifactVersion.html">
<code>DefaultArtifactVersion</code>
</a>
in the core of Maven expects that version numbers will have a very
specific format:
</p>
<p>
<i>MajorVersion [</i>
<code>.</code>
<i>MinorVersion [</i>
<code>.</code>
<i>IncrementalVersion ] ] [</i>
<code>-</code>
<i>BuildNumber | Qualifier ]</i>
</p>
<p>Where<i>MajorVersion</i>,<i>MinorVersion</i>,<i>IncrementalVersion</i>, and
<i>BuildNumber</i>
are all
numeric and
<i>Qualifier</i>
is a string. If your version number does not match this format, then the entire
version number is treated as being the<i>Qualifier</i>.
</p>
<p>Version numbers in maven are compared using the individual components, so<i>MajorVersion</i>,<i>
MinorVersion</i>,<i>IncrementalVersion</i>, and
<i>BuildNumber</i>
are all compared as<code>Integer</code>s
while
<i>Qualifier</i>
is compared as a<code>String</code>.
</p>
<p>From the above you may have guessed neither
<code>1.0.0.9</code>
nor
<code>1.0.0.23</code>
match the exact
format that Maven expects, and as a result they are mapped as being just a<i>Qualifier</i>.
String comparison will sort
<code>1.0.0.9</code>
><code>1.0.0.23</code>.
</p>
<p>If you need version numbers to be sorted "correctly" you will need to define some
<a href="version-rules.html">
version number comparison rules
</a>.
</p>
</answer>
</faq>
<faq id="repo-metadata">
<question>Why is foo:bar version x.y.z not being detected?</question>
<answer>
<p>
In order to determine what versions of an artifact are present, Maven relies on the presence of
meta-data files in the repository. If the meta-data files are missing or contain invalid information
then Maven will not know about versions that are available in your repositories.
</p>
<p>
Here are some common reasons why your metadata can be invalid:
</p>
<ul>
<li>
You are using a local repository as a remote repository. Stop, don't do this. The local repository
uses a separate set of metadata files from those used by a remote repository. There are tools available
to convert a local repository into a remote repository, but you're really better off using a repository
manager.
</li>
<li>
Artifacts have been deployed by non-maven metadata aware tools.
</li>
<li>
Tools that claim to be maven meta-data aware have clobbered the metadata files.
</li>
</ul>
<p>
In most cases, using a repository manager will solve these issues as the repository managers usually
rebuild the metadata files based on the artifacts that are present.
</p>
</answer>
</faq>
</part>
</faqs>