Unverified Commit e506a272 authored by ZackYoung's avatar ZackYoung Committed by GitHub

fix_version (#2474)

parent be13e0c0
......@@ -19,11 +19,12 @@
package org.dinky.configure;
import org.dinky.DinkyVersion;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
......@@ -61,8 +62,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
@Import(BeanValidatorPluginsConfiguration.class)
public class Knife4jConfig {
@Value("${dinky.version}")
private String dinkyVersion;
private final String dinkyVersion = DinkyVersion.getVersion();
private final OpenApiExtensionResolver openApiExtensionResolver;
......
......@@ -154,8 +154,6 @@ sa-token:
knife4j:
enable: true
dinky:
version: ${revision}
sms:
is-print: false
......
......@@ -158,4 +158,25 @@
</dependency>
</dependencies>
<build>
<resources>
<!-- Replace maven global variables -->
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>common.properties</include>
</includes>
</resource>
<!-- Keep files with variables that are not replaced -->
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
<excludes>
<exclude>common.properties</exclude>
</excludes>
</resource>
</resources>
</build>
</project>
/*
*
* 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.
*
*/
package org.dinky;
import cn.hutool.setting.dialect.Props;
public final class DinkyVersion {
private DinkyVersion() {}
/**
* Return the full version string of the present Dinky codebase.
*
* @return the version of Dinky
*/
public static String getVersion() {
try {
return Props.getProp("common.properties").getProperty("version");
} catch (Exception e) {
return "${revision}";
}
}
}
version=${project.version}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment