Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hugegraph-commons/hugegraph-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@
</dependencyManagement>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Objects;
import java.util.Properties;
import java.util.jar.Attributes;
import java.util.jar.Manifest;

Expand Down Expand Up @@ -233,4 +235,16 @@ public String toString() {
return this.version;
}
}

public static String getVersionNumber() {
final Properties PROPS = new Properties();

try (InputStream is =
VersionUtil.class.getResourceAsStream("/version.properties")) {
PROPS.load(is);
} catch (IOException e) {
throw new RuntimeException("Could not load version.properties", e);
}
return PROPS.getProperty("version");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@

package org.apache.hugegraph.version;

import org.apache.hugegraph.util.VersionUtil.Version;
import org.apache.hugegraph.util.VersionUtil;


public class CommonVersion {

public static final String NAME = "hugegraph-common";

// The second parameter of Version.of() is for all-in-one JAR
public static final Version VERSION = Version.of(CommonVersion.class, "1.5.0");
public static final VersionUtil.Version
VERSION = VersionUtil.Version.of(CommonVersion.class, VersionUtil.getVersionNumber());

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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.

version=${revision}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

package org.apache.hugegraph.version;

import org.apache.hugegraph.util.VersionUtil.Version;
import org.apache.hugegraph.util.VersionUtil;

public class RpcVersion {

public static final String NAME = "hugegraph-rpc";

// The second parameter of Version.of() is for all-in-one JAR
public static final Version VERSION = Version.of(RpcVersion.class, "1.5.0");
public static final VersionUtil.Version VERSION = VersionUtil.Version.of(
RpcVersion.class, VersionUtil.getVersionNumber());
}
2 changes: 1 addition & 1 deletion hugegraph-pd/hg-pd-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-common</artifactId>
<version>1.2.0</version>
<version>${hugegraph-commons.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
import com.google.protobuf.MessageOrBuilder;
import com.google.protobuf.util.JsonFormat;

import org.apache.hugegraph.util.VersionUtil;

public class API {

// TODO: use a flexible way to define the version
// refer: https://github.com/apache/hugegraph/pull/2528#discussion_r1573823996
public static final String VERSION = "1.5.0";
public static final String VERSION = VersionUtil.getVersionNumber();
public static final String PD = "PD";
public static final String STORE = "STORE";
public static String STATUS_KEY = "status";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
set -ev

HOME_DIR=$(pwd)
PD_DIR=$HOME_DIR/hugegraph-pd/apache-hugegraph-pd-incubating-1.5.0
source $HOME_DIR/hugegraph-commons/hugegraph-common/src/main/resources/version.properties
PD_DIR=$HOME_DIR/hugegraph-pd/apache-hugegraph-pd-incubating-${version}

pushd $PD_DIR
. bin/start-hugegraph-pd.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
set -ev

HOME_DIR=$(pwd)
STORE_DIR=$HOME_DIR/hugegraph-store/apache-hugegraph-store-incubating-1.5.0

source $HOME_DIR/hugegraph-commons/hugegraph-common/src/main/resources/version.properties
STORE_DIR=$HOME_DIR/hugegraph-store/apache-hugegraph-store-incubating-${version}

pushd $STORE_DIR
. bin/start-hugegraph-store.sh
Expand Down
Loading