mirror of https://github.com/apache/jclouds.git
[issue 802] Simplified by using a Maven-provided and generated file instead of jclouds-version.properties
This commit is contained in:
parent
add431a329
commit
54506e6da5
18
core/pom.xml
18
core/pom.xml
|
@ -114,24 +114,6 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/clojure</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>META-INF/jclouds-version.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<includes>
|
||||
<include>META-INF/jclouds-version.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
|
|
|
@ -36,8 +36,8 @@ import com.google.common.annotations.VisibleForTesting;
|
|||
*/
|
||||
public class JcloudsVersion {
|
||||
@VisibleForTesting
|
||||
static final String VERSION_RESOURCE_FILE = "META-INF/jclouds-version.properties";
|
||||
private static final String VERSION_PROPERTY_NAME = "jclouds.version";
|
||||
static final String VERSION_RESOURCE_FILE = "META-INF/maven/org.jclouds/jclouds-core/pom.properties";
|
||||
private static final String VERSION_PROPERTY_NAME = "version";
|
||||
|
||||
// TODO: stop supporting x.y.z-rc-n after the 1.3.0 release
|
||||
// x.y.z or x.y.z-rc.n or x.y.z-rc-n, optionally with -SNAPSHOT suffix - see http://semver.org
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
jclouds.version=${project.version}
|
|
@ -54,6 +54,12 @@ public class JcloudsVersionTest {
|
|||
new JcloudsVersion("${project.version}");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtractsVersionFromResourceFile() {
|
||||
JcloudsVersion version = new JcloudsVersion();
|
||||
assertEquals("0.0.0-SNAPSHOT", version.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtractsMajorMinorPatchVersions() {
|
||||
JcloudsVersion version = new JcloudsVersion("1.2.3");
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# Dummy pom.properties file for testing
|
||||
version=0.0.0-SNAPSHOT
|
||||
groupId=org.jclouds
|
||||
artifactId=jclouds-core
|
Loading…
Reference in New Issue