Skip to content

Commit 8b14f8a

Browse files
committed
VersionUtils: prefer version from manifest
This is because the manifest may also contain other information such as the SCM revision, which will start mattering shortly (see next commit).
1 parent 81c705f commit 8b14f8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/scijava/util/VersionUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ public static String getVersion(final Class<?> c) {
6464
public static String getVersion(final Class<?> c, final String groupId,
6565
final String artifactId)
6666
{
67-
final String pomVersion = getVersionFromPOM(c, groupId, artifactId);
68-
return pomVersion != null ? pomVersion : getVersionFromManifest(c);
67+
final String version = getVersionFromManifest(c);
68+
if (version != null) return version;
69+
return getVersionFromPOM(c, groupId, artifactId);
6970
}
7071

7172
/**

0 commit comments

Comments
 (0)