mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-21 13:04:28 +02:00
Resolve native lib version collectly by referring VERSION file
This commit is contained in:
parent
f7c90faa1d
commit
26774e3ca7
7
pom.xml
7
pom.xml
@ -13,6 +13,12 @@
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>org/xerial/snappy/VERSION</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
@ -23,7 +29,6 @@
|
||||
<directory>${basedir}</directory>
|
||||
<targetPath>META-INF/maven/${project.groupId}/${project.artifactId}</targetPath>
|
||||
<includes>
|
||||
<include>VERSION</include>
|
||||
<include>LICENSE*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
|
@ -96,7 +96,6 @@ public class LoadSnappy
|
||||
String targetFolder) {
|
||||
String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;
|
||||
final String prefix = "snappy-" + getVersion() + "-";
|
||||
|
||||
String extractedLibFileName = prefix + libraryFileName;
|
||||
File extractedLibFile = new File(targetFolder, extractedLibFileName);
|
||||
|
||||
@ -226,7 +225,7 @@ public class LoadSnappy
|
||||
|
||||
URL versionFile = LoadSnappy.class.getResource("/META-INF/maven/org.xerial.snappy/snappy-java/pom.properties");
|
||||
if (versionFile == null)
|
||||
versionFile = LoadSnappy.class.getResource("/META-INF/maven/org.xerial.snappy/snappy-java/VERSION");
|
||||
versionFile = LoadSnappy.class.getResource("/org/xerial/snappy/VERSION");
|
||||
|
||||
String version = "unknown";
|
||||
try {
|
||||
@ -234,6 +233,8 @@ public class LoadSnappy
|
||||
Properties versionData = new Properties();
|
||||
versionData.load(versionFile.openStream());
|
||||
version = versionData.getProperty("version", version);
|
||||
if (version.equals("unknown"))
|
||||
version = versionData.getProperty("VERSION", version);
|
||||
version = version.trim().replaceAll("[^0-9\\.]", "");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user