File tree Expand file tree Collapse file tree 5 files changed +31
-26
lines changed
java/org/apache/inlong/sdk/dataproxy/utils Expand file tree Collapse file tree 5 files changed +31
-26
lines changed Original file line number Diff line number Diff line change @@ -93,4 +93,7 @@ header:
9393 - ' **/tubemq-client-go/go.sum'
9494 - ' **/dataproxy-sdk-golang/go.sum'
9595
96+ # dataproxy sdk version
97+ - ' **/resources/sdk.version'
98+
9699 comment : on-failure
Original file line number Diff line number Diff line change 117117 </dependencies >
118118
119119 <build >
120+ <resources >
121+ <resource >
122+ <filtering >true</filtering >
123+ <directory >src/main/resources</directory >
124+ </resource >
125+ </resources >
120126 <plugins >
127+ <plugin >
128+ <groupId >org.apache.maven.plugins</groupId >
129+ <artifactId >maven-resources-plugin</artifactId >
130+ <configuration >
131+ <encoding >UTF-8</encoding >
132+ </configuration >
133+ </plugin >
121134 <plugin >
122135 <groupId >org.apache.maven.plugins</groupId >
123136 <artifactId >maven-compiler-plugin</artifactId >
174187 </execution >
175188 </executions >
176189 </plugin >
177- <plugin >
178- <groupId >io.github.git-commit-id</groupId >
179- <artifactId >git-commit-id-maven-plugin</artifactId >
180- <version >4.9.9</version >
181- <configuration >
182- <generateGitPropertiesFile >true</generateGitPropertiesFile >
183- <generateGitPropertiesFilename >${project.build.outputDirectory} /git.properties</generateGitPropertiesFilename >
184- <includeOnlyProperties >
185- <includeOnlyProperty >^git.build.(version)$</includeOnlyProperty >
186- </includeOnlyProperties >
187- <commitIdGenerationMode >full</commitIdGenerationMode >
188- </configuration >
189- <executions >
190- <execution >
191- <id >get-the-git-infos</id >
192- <goals >
193- <goal >revision</goal >
194- </goals >
195- <phase >initialize</phase >
196- </execution >
197- </executions >
198- </plugin >
199190 </plugins >
200191 </build >
201192
Original file line number Diff line number Diff line change @@ -104,11 +104,19 @@ public static String getJarVersion() {
104104 if (sdkVersion != null ) {
105105 return sdkVersion ;
106106 }
107- Properties properties = new Properties ();
108- try (InputStream is = ProxyUtils .class .getResourceAsStream ("/git.properties" )) {
109- properties .load (is );
110- sdkVersion = properties .getProperty ("git.build.version" );
107+ try (InputStream is = ProxyUtils .class .getClassLoader ().getResourceAsStream ("sdk.version" )) {
108+ if (is == null ) {
109+ sdkVersion = "unknown" ;
110+ if (exceptCounter .shouldPrint ()) {
111+ logger .error ("Missing sdk.version file!" );
112+ }
113+ } else {
114+ Properties properties = new Properties ();
115+ properties .load (is );
116+ sdkVersion = properties .getProperty ("version" );
117+ }
111118 } catch (Throwable ex ) {
119+ sdkVersion = "unknown" ;
112120 if (exceptCounter .shouldPrint ()) {
113121 logger .error ("DataProxy-SDK get version failure" , ex );
114122 }
Original file line number Diff line number Diff line change 1+ version=${project.version}
Original file line number Diff line number Diff line change 14901490 <exclude >**/dataproxy-sdk-golang/go.sum</exclude >
14911491 <!-- Docker build-->
14921492 <exclude >**/docker/docker-compose/**/**</exclude >
1493+ <!-- dataproxy sdk version -->
1494+ <exclude >**/resources/sdk.version</exclude >
14931495
14941496 </excludes >
14951497 </configuration >
You can’t perform that action at this time.
0 commit comments