Skip to content

Commit

Permalink
Merge pull request #31 from idpass/1.2.0
Browse files Browse the repository at this point in the history
1.2.0
  • Loading branch information
MonobikashDas committed May 6, 2022
2 parents 2c980ae + 1548bd6 commit 9412251
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 55 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/clear_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ jobs:
delete-artifacts:
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
- name: Purge Artifacts
if: env.ACCESS_TOKEN != null
uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets. access_token }}
token: ${{ secrets.access_token }}
expire-in: 2days # Setting this to 0 will delete all artifacts
env:
ACCESS_TOKEN: ${{ secrets.access_token }}
94 changes: 48 additions & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>io.mosip</groupId>
<artifactId>mimoto</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<name>mimoto</name>
<description>Mobile server backend supporting Inji.</description>

Expand Down Expand Up @@ -50,7 +50,9 @@
<logback.version>1.2.3</logback.version>

<!-- json -->
<jackson.version>2.13.1</jackson.version>
<jackson.version>2.13.2</jackson.version>
<!-- jackson-databind security patch version -->
<jackson.databind.version>2.13.2.2</jackson.databind.version>
<json.utility.version>20180130</json.utility.version>
<json.schema.validator.version>2.2.10</json.schema.validator.version>
<json.version>20180813</json.version>
Expand Down Expand Up @@ -192,7 +194,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.6</version>
<version>1.2.9</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
Expand Down Expand Up @@ -238,7 +240,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<version>${jackson.databind.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -513,9 +515,9 @@
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
Expand All @@ -527,48 +529,48 @@
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<generateGitPropertiesFilename>${project.build.outputDirectory}/build.json</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
<includeOnlyProperty>^git.branch$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<!-- <format>json</format> -->
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sonar</id>
<properties>
<sonar.sources>.</sonar.sources>
<sonar.inclusions>src/main/java/**,src/main/resources/**</sonar.inclusions>
<sonar.exclusions>${sonar.coverage.exclusions}</sonar.exclusions>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${maven.sonar.plugin.version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<format>json</format>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sonar</id>
<properties>
<sonar.sources>.</sonar.sources>
<sonar.inclusions>src/main/java/**,src/main/resources/**</sonar.inclusions>
<sonar.exclusions>${sonar.coverage.exclusions}</sonar.exclusions>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${maven.sonar.plugin.version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
</project>
20 changes: 20 additions & 0 deletions scripts/generate_THIRDPARTY.md.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generates THIRDPARTY.md license report as gathered from pom.xml
# Usage:
# pip install markdownify
# python scripts/generate_THIRDPARTY.md.py
#
# A THIRDPARTY.md file is generated at project's root folder.

import markdownify
import subprocess
import sys

subprocess.run(['mvn', 'clean'])
subprocess.run(['mvn', 'project-info-reports:dependencies'])
html = open('target/site/dependencies.html').read()
h = markdownify.markdownify(html, heading_style="ATX")
with open('THIRDPARTY.md','w') as f:
for line in h.splitlines():
if 'Project Dependency Graph' in line:
break
print(line, file=f)
33 changes: 26 additions & 7 deletions src/main/java/io/mosip/mimoto/MimotoServiceApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.mosip.mimoto;

import com.fasterxml.jackson.databind.ObjectMapper;

import org.json.simple.JSONObject;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
Expand All @@ -15,22 +18,18 @@
import io.mosip.mimoto.service.impl.CbeffImpl;
import io.mosip.mimoto.spi.CbeffUtil;

@SpringBootApplication(
scanBasePackages = {
@SpringBootApplication(scanBasePackages = {
"io.mosip.mimoto.*",
"${mosip.auth.adapter.impl.basepackage}"
},
exclude = {
}, exclude = {
SecurityAutoConfiguration.class,
DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class,
CacheAutoConfiguration.class
}
)
})
@EnableScheduling
@EnableAsync
public class MimotoServiceApplication {

@Bean
@Primary
public CbeffUtil getCbeffUtil() {
Expand All @@ -45,7 +44,27 @@ public ThreadPoolTaskScheduler taskScheduler() {
return threadPoolTaskScheduler;
}

public static JSONObject getGitProp() {
try {
return (new ObjectMapper()).readValue(
MimotoServiceApplication.class.getClassLoader().getResourceAsStream("build.json"),
JSONObject.class
);
} catch (Exception e) {
System.err.println("Error when trying to read build.json file: " + e);
}
return new JSONObject();
}

public static void main(String[] args) {
JSONObject gitProp = getGitProp();
System.out.println(
String.format(
"Mimoto Service version: %s - revision: %s @ branch: %s | build @ %s",
gitProp.get("git.build.version"),
gitProp.get("git.commit.id.abbrev"),
gitProp.get("git.branch"),
gitProp.get("git.build.time")));
SpringApplication.run(MimotoServiceApplication.class, args);
}

Expand Down

0 comments on commit 9412251

Please sign in to comment.