Skip to content

Commit 9412251

Browse files
Merge pull request #31 from idpass/1.2.0
1.2.0
2 parents 2c980ae + 1548bd6 commit 9412251

File tree

4 files changed

+100
-55
lines changed

4 files changed

+100
-55
lines changed

.github/workflows/clear_artifacts.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ jobs:
77
delete-artifacts:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: kolpav/purge-artifacts-action@v1
10+
- name: Purge Artifacts
11+
if: env.ACCESS_TOKEN != null
12+
uses: kolpav/purge-artifacts-action@v1
1113
with:
12-
token: ${{ secrets. access_token }}
14+
token: ${{ secrets.access_token }}
1315
expire-in: 2days # Setting this to 0 will delete all artifacts
16+
env:
17+
ACCESS_TOKEN: ${{ secrets.access_token }}

pom.xml

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<groupId>io.mosip</groupId>
1111
<artifactId>mimoto</artifactId>
12-
<version>0.2.0-SNAPSHOT</version>
12+
<version>1.2.0-SNAPSHOT</version>
1313
<name>mimoto</name>
1414
<description>Mobile server backend supporting Inji.</description>
1515

@@ -50,7 +50,9 @@
5050
<logback.version>1.2.3</logback.version>
5151

5252
<!-- json -->
53-
<jackson.version>2.13.1</jackson.version>
53+
<jackson.version>2.13.2</jackson.version>
54+
<!-- jackson-databind security patch version -->
55+
<jackson.databind.version>2.13.2.2</jackson.databind.version>
5456
<json.utility.version>20180130</json.utility.version>
5557
<json.schema.validator.version>2.2.10</json.schema.validator.version>
5658
<json.version>20180813</json.version>
@@ -192,7 +194,7 @@
192194
<dependency>
193195
<groupId>ch.qos.logback</groupId>
194196
<artifactId>logback-core</artifactId>
195-
<version>1.2.6</version>
197+
<version>1.2.9</version>
196198
</dependency>
197199
<dependency>
198200
<groupId>joda-time</groupId>
@@ -238,7 +240,7 @@
238240
<dependency>
239241
<groupId>com.fasterxml.jackson.core</groupId>
240242
<artifactId>jackson-databind</artifactId>
241-
<version>${jackson.version}</version>
243+
<version>${jackson.databind.version}</version>
242244
</dependency>
243245
<dependency>
244246
<groupId>com.fasterxml.jackson.core</groupId>
@@ -513,9 +515,9 @@
513515
</executions>
514516
</plugin>
515517
<plugin>
516-
<groupId>pl.project13.maven</groupId>
517-
<artifactId>git-commit-id-plugin</artifactId>
518-
<version>3.0.1</version>
518+
<groupId>io.github.git-commit-id</groupId>
519+
<artifactId>git-commit-id-maven-plugin</artifactId>
520+
<version>5.0.0</version>
519521
<executions>
520522
<execution>
521523
<id>get-the-git-infos</id>
@@ -527,48 +529,48 @@
527529
</executions>
528530
<configuration>
529531
<generateGitPropertiesFile>true</generateGitPropertiesFile>
530-
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
532+
<generateGitPropertiesFilename>${project.build.outputDirectory}/build.json</generateGitPropertiesFilename>
531533
<includeOnlyProperties>
532534
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
533535
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
536+
<includeOnlyProperty>^git.branch$</includeOnlyProperty>
534537
</includeOnlyProperties>
535538
<commitIdGenerationMode>full</commitIdGenerationMode>
536-
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
537-
<!-- <format>json</format> -->
538-
</configuration>
539-
</plugin>
540-
</plugins>
541-
</build>
542-
<profiles>
543-
<profile>
544-
<id>sonar</id>
545-
<properties>
546-
<sonar.sources>.</sonar.sources>
547-
<sonar.inclusions>src/main/java/**,src/main/resources/**</sonar.inclusions>
548-
<sonar.exclusions>${sonar.coverage.exclusions}</sonar.exclusions>
549-
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
550-
</properties>
551-
<activation>
552-
<activeByDefault>false</activeByDefault>
553-
</activation>
554-
<build>
555-
<plugins>
556-
<plugin>
557-
<groupId>org.sonarsource.scanner.maven</groupId>
558-
<artifactId>sonar-maven-plugin</artifactId>
559-
<version>${maven.sonar.plugin.version}</version>
560-
<executions>
561-
<execution>
562-
<phase>verify</phase>
563-
<goals>
564-
<goal>sonar</goal>
565-
</goals>
566-
</execution>
567-
</executions>
568-
</plugin>
569-
</plugins>
570-
</build>
571-
</profile>
572-
</profiles>
539+
<format>json</format>
540+
</configuration>
541+
</plugin>
542+
</plugins>
543+
</build>
544+
<profiles>
545+
<profile>
546+
<id>sonar</id>
547+
<properties>
548+
<sonar.sources>.</sonar.sources>
549+
<sonar.inclusions>src/main/java/**,src/main/resources/**</sonar.inclusions>
550+
<sonar.exclusions>${sonar.coverage.exclusions}</sonar.exclusions>
551+
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
552+
</properties>
553+
<activation>
554+
<activeByDefault>false</activeByDefault>
555+
</activation>
556+
<build>
557+
<plugins>
558+
<plugin>
559+
<groupId>org.sonarsource.scanner.maven</groupId>
560+
<artifactId>sonar-maven-plugin</artifactId>
561+
<version>${maven.sonar.plugin.version}</version>
562+
<executions>
563+
<execution>
564+
<phase>verify</phase>
565+
<goals>
566+
<goal>sonar</goal>
567+
</goals>
568+
</execution>
569+
</executions>
570+
</plugin>
571+
</plugins>
572+
</build>
573+
</profile>
574+
</profiles>
573575

574-
</project>
576+
</project>

scripts/generate_THIRDPARTY.md.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generates THIRDPARTY.md license report as gathered from pom.xml
2+
# Usage:
3+
# pip install markdownify
4+
# python scripts/generate_THIRDPARTY.md.py
5+
#
6+
# A THIRDPARTY.md file is generated at project's root folder.
7+
8+
import markdownify
9+
import subprocess
10+
import sys
11+
12+
subprocess.run(['mvn', 'clean'])
13+
subprocess.run(['mvn', 'project-info-reports:dependencies'])
14+
html = open('target/site/dependencies.html').read()
15+
h = markdownify.markdownify(html, heading_style="ATX")
16+
with open('THIRDPARTY.md','w') as f:
17+
for line in h.splitlines():
18+
if 'Project Dependency Graph' in line:
19+
break
20+
print(line, file=f)

src/main/java/io/mosip/mimoto/MimotoServiceApplication.java

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package io.mosip.mimoto;
22

3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
5+
import org.json.simple.JSONObject;
36
import org.springframework.boot.SpringApplication;
47
import org.springframework.boot.autoconfigure.SpringBootApplication;
58
import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
@@ -15,22 +18,18 @@
1518
import io.mosip.mimoto.service.impl.CbeffImpl;
1619
import io.mosip.mimoto.spi.CbeffUtil;
1720

18-
@SpringBootApplication(
19-
scanBasePackages = {
21+
@SpringBootApplication(scanBasePackages = {
2022
"io.mosip.mimoto.*",
2123
"${mosip.auth.adapter.impl.basepackage}"
22-
},
23-
exclude = {
24+
}, exclude = {
2425
SecurityAutoConfiguration.class,
2526
DataSourceAutoConfiguration.class,
2627
HibernateJpaAutoConfiguration.class,
2728
CacheAutoConfiguration.class
28-
}
29-
)
29+
})
3030
@EnableScheduling
3131
@EnableAsync
3232
public class MimotoServiceApplication {
33-
3433
@Bean
3534
@Primary
3635
public CbeffUtil getCbeffUtil() {
@@ -45,7 +44,27 @@ public ThreadPoolTaskScheduler taskScheduler() {
4544
return threadPoolTaskScheduler;
4645
}
4746

47+
public static JSONObject getGitProp() {
48+
try {
49+
return (new ObjectMapper()).readValue(
50+
MimotoServiceApplication.class.getClassLoader().getResourceAsStream("build.json"),
51+
JSONObject.class
52+
);
53+
} catch (Exception e) {
54+
System.err.println("Error when trying to read build.json file: " + e);
55+
}
56+
return new JSONObject();
57+
}
58+
4859
public static void main(String[] args) {
60+
JSONObject gitProp = getGitProp();
61+
System.out.println(
62+
String.format(
63+
"Mimoto Service version: %s - revision: %s @ branch: %s | build @ %s",
64+
gitProp.get("git.build.version"),
65+
gitProp.get("git.commit.id.abbrev"),
66+
gitProp.get("git.branch"),
67+
gitProp.get("git.build.time")));
4968
SpringApplication.run(MimotoServiceApplication.class, args);
5069
}
5170

0 commit comments

Comments
 (0)