Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #303 from boschresearch/feature/did-web-v2-02
Browse files Browse the repository at this point in the history
Feature/did web v2 02
  • Loading branch information
etschelp authored Dec 21, 2020
2 parents 2b0b597 + 4cadfae commit 2061f18
Show file tree
Hide file tree
Showing 192 changed files with 773 additions and 670 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ formatter-maven-cache.properties

# Build
**/target/**
/docker-compose-backend.yml

# Ignore dynamically added frontend files
backend/company-agent/src/main/resources/public/**
backend/*/src/main/resources/public/**

# --------------------------------------
# Frontend
Expand Down
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ WORKDIR /home/maven/backend

# Copy Files
COPY backend/pom.xml backend/formatter.xml ./
COPY backend/company-agent ./company-agent
COPY backend/company-agent-core ./company-agent-core
COPY backend/business-partner-agent ./business-partner-agent
COPY backend/business-partner-agent-core ./business-partner-agent-core
COPY frontend ../frontend

# Cache Maven Artefacts
RUN mvn dependency:go-offline || true

# Generate License Info
RUN mvn -f company-agent-core/pom.xml clean install -Dspotbugs.skip=true -Dpmd.skip=true
RUN mvn attribution:generate-attribution-file
RUN cp ./company-agent/target/attribution.xml ../frontend/licenses/attribution.xml
RUN mvn clean install -N
RUN mvn -f business-partner-agent-core/pom.xml clean install -Dspotbugs.skip=true -Dpmd.skip=true
RUN mvn -f business-partner-agent/pom.xml license:third-party-report xml:transform -Pgenerate-license-info
RUN cp ./business-partner-agent/target/generated-resources/xml/xslt/third-party-report.xml ../frontend/licenses/attribution.xml

# Build .jar
RUN mvn clean install -P build-frontend -DskipTests=true -Dspotbugs.skip=true -Dpmd.skip=true

# Runtime Container
FROM amazoncorretto:15-alpine
COPY --from=0 /home/maven/backend/company-agent/target/organizational-agent*SNAPSHOT.jar organizational-agent.jar
COPY --from=0 /home/maven/backend/business-partner-agent/target/business-partner-agent*SNAPSHOT.jar business-partner-agent.jar

EXPOSE 8080
CMD java -XX:+UnlockExperimentalVMOptions -Dcom.sun.management.jmxremote -noverify ${JAVA_OPTS} -jar organizational-agent.jar
CMD java -XX:+UnlockExperimentalVMOptions -Dcom.sun.management.jmxremote -noverify ${JAVA_OPTS} -jar business-partner-agent.jar
10 changes: 7 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pipeline {
agent any

environment {
REG_IMAGE = 'agent-registry'
SETTINGS_ID = 'a77b84ea-0de6-4ede-8961-060229a96fcf'
MVN_VERSION = 'maven-3.6.x'
}
Expand All @@ -22,8 +21,13 @@ pipeline {
jdk: "java-11",
maven: "${MVN_VERSION}",
globalMavenSettingsConfig: "${SETTINGS_ID}") {
sh "mvn clean deploy -Pbuild-frontend -DaltDeploymentRepository=bds-nexus::default::https://nexus.bosch-digital.com/repository/bds-snapshots/"
sh "mvn docker:build docker:push -Ddocker.push.registry=nexus.bosch-digital.com:5000 -Ddocker.name=bds/%a"
sh 'mvn clean'
sh 'mvn install -N'
sh 'mvn -f business-partner-agent-core/pom.xml install -Dspotbugs.skip=true -Dpmd.skip=true'
sh 'mvn -f business-partner-agent/pom.xml license:third-party-report xml:transform -Pgenerate-license-info'
sh 'cp ./business-partner-agent/target/generated-resources/xml/xslt/third-party-report.xml ../frontend/licenses/attribution.xml'
sh "mvn deploy -Pbuild-frontend -DaltDeploymentRepository=bds-nexus::default::https://nexus.bosch-digital.com/repository/bds-snapshots/"
sh "mvn docker:build docker:push -Ddocker.push.registry=nexus.bosch-digital.com:5000 -Ddocker.name=bds/%a"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.hyperledger.organizational-agent</groupId>
<artifactId>organizational-agent-parent</artifactId>
<groupId>org.hyperledger.business-partner-agent</groupId>
<artifactId>business-partner-agent-parent</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<artifactId>organizational-agent-core</artifactId>
<artifactId>business-partner-agent-core</artifactId>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
<description>organizational-agent: shared core classes</description>
<url>https://github.com/hyperledger-labs/organizational-agent</url>
<description>business-partner-agent: shared core classes</description>
<url>https://github.com/hyperledger-labs/business-partner-agent</url>

<properties>
<skip.docker.build>true</skip.docker.build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.core;
package org.hyperledger.bpa.core;

import lombok.*;
import lombok.experimental.SuperBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.core;
package org.hyperledger.bpa.core;

import org.hyperledger.oa.core.RegisteredWebhook.WebhookEventType;
import org.hyperledger.bpa.core.RegisteredWebhook.WebhookEventType;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In you IDE e.g. Eclipse righ click Application.java Run As/Run Configurations an
If you want to run in web only mode you also have to set:

```
-Doagent.web.only=true
-Dbpa.web.only=true
```

### Aries Mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.hyperledger.organizational-agent</groupId>
<artifactId>organizational-agent-parent</artifactId>
<groupId>org.hyperledger.business-partner-agent</groupId>
<artifactId>business-partner-agent-parent</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<artifactId>organizational-agent</artifactId>
<artifactId>business-partner-agent</artifactId>
<packaging>jar</packaging>


<name>${project.groupId}:${project.artifactId}</name>
<description>organizational-agent: backend</description>
<description>business-partner-agent: backend</description>
<url>https://github.com/hyperledger-labs/business-partner-agent</url>

<properties>
<!-- Settings -->
<exec.mainClass>org.hyperledger.oa.Application</exec.mainClass>
<exec.mainClass>org.hyperledger.bpa.Application</exec.mainClass>
<skip.docker.build>false</skip.docker.build>
</properties>

Expand All @@ -29,6 +29,13 @@
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject</artifactId>
<exclusions>
<exclusion>
<!-- incompatible license! -->
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
Expand Down Expand Up @@ -78,6 +85,11 @@
<version>2.2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
Expand All @@ -102,8 +114,8 @@
<version>0.5.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.hyperledger.organizational-agent</groupId>
<artifactId>organizational-agent-core</artifactId>
<groupId>org.hyperledger.business-partner-agent</groupId>
<artifactId>business-partner-agent-core</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down Expand Up @@ -163,7 +175,6 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -257,12 +268,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<!-- mvn license:third-party-report -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.0.0</version>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -350,5 +355,71 @@
</plugins>
</build>
</profile>
<profile>
<id>generate-license-info</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<!-- mvn license:third-party-report -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.0.1-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>third-party-report</goal>
</goals>
</execution>
</executions>
<configuration>
<excludedScopes>test,provided</excludedScopes>
<excludedArtifacts>spotbugs-annotations</excludedArtifacts><!-- Not shipped -->
<licenseMerges>
<licenseMerge>The Apache Software License, Version 2.0|The Apache License, Version 2.0|Apache License, Version 2.0|Apache License 2.0|Apache 2.0</licenseMerge>
<licenseMerge>The MIT License|MIT License</licenseMerge>
</licenseMerges>
</configuration>
</plugin>
<!-- mvn xml:transform -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<dir>${project.build.directory}/site</dir>
<stylesheet>src/main/resources/xml/stylesheet.xsl</stylesheet>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
<targetExtension>.xml</targetExtension>
</fileMapper>
</fileMappers>
</transformationSet>
</transformationSets>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>10.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa;
package org.hyperledger.bpa;

import io.micronaut.runtime.Micronaut;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
Expand All @@ -24,9 +24,9 @@

@OpenAPIDefinition(
info = @Info(
title = "Organizational Agent",
title = "Business Partner Agent",
version = "0.1",
description = "Organizational Agent API",
description = "Business Partner Agent API",
license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0")))
public class Application {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api;
package org.hyperledger.bpa.api;

public class ApiConstants {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api;
package org.hyperledger.bpa.api;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api;
package org.hyperledger.bpa.api;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api;
package org.hyperledger.bpa.api;

import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hyperledger.oa.controller.api.wallet.WalletDocumentRequest;
import org.hyperledger.bpa.controller.api.wallet.WalletDocumentRequest;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api;
package org.hyperledger.bpa.api;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.JsonNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api.aries;
package org.hyperledger.bpa.api.aries;

import lombok.*;
import org.hyperledger.oa.model.MyCredential;
import org.hyperledger.bpa.model.MyCredential;

import java.util.Map;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api.aries;
package org.hyperledger.bpa.api.aries;

import com.fasterxml.jackson.databind.JsonNode;
import lombok.*;
import org.hyperledger.oa.model.PartnerProof;
import org.hyperledger.bpa.model.PartnerProof;

import javax.annotation.Nullable;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.hyperledger.oa.api.aries;
package org.hyperledger.bpa.api.aries;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Loading

0 comments on commit 2061f18

Please sign in to comment.