Skip to content

Commit

Permalink
Merge pull request #120 from correctexam/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
barais authored Jan 24, 2024
2 parents bf9392a + 747ed38 commit b442b96
Show file tree
Hide file tree
Showing 174 changed files with 618 additions and 1,009 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Java CI with Maven

on:
push:
branches: [ develop1 ]
branches: [ develop ]

jobs:
build:
Expand All @@ -14,11 +14,25 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml -Pnative
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./
file: ./src/main/docker/Dockerfile.native
push: true
tags: barais/grade-scope-istic:develop
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
Expand Down
78 changes: 53 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<version>1.0.0-SNAPSHOT</version>
<name>CorrectExam</name>
<properties>
<archunit-junit5.version>1.0.1</archunit-junit5.version>
<archunit-junit5.version>1.2.1</archunit-junit5.version>
<cas.version>3.6.4</cas.version>
<checkstyle.version>8.27</checkstyle.version>
<git-commit-id-plugin.version>4.0.0</git-commit-id-plugin.version>
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<jacoco.utReportFile>${jacoco.utReportFolder}/test.exec</jacoco.utReportFile>
<jacoco.utReportFolder>${project.build.directory}/jacoco/test</jacoco.utReportFolder>
<java.version>11</java.version>
Expand All @@ -33,16 +33,16 @@
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.version>3.6.3</maven.version>
<maven.version>3.8.1</maven.version>
<node.version>v18.12.0</node.version>
<npm.version>8.19.2</npm.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
<quarkus-plugin.version>2.16.8.Final</quarkus-plugin.version>
<quarkus-plugin.version>3.6.4</quarkus-plugin.version>
<quarkus.logManager>org.jboss.logmanager.LogManager</quarkus.logManager>
<quarkus.platform.version>2.16.8.Final</quarkus.platform.version>
<quarkus.platform.version>3.6.4</quarkus.platform.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
</properties>
<dependencyManagement>
Expand All @@ -57,21 +57,37 @@
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>


<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>3.0.0</version>
</dependency>
<version>3.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.quarkus/quarkus-awt -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-awt</artifactId>
<version>3.6.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.camel.quarkus/camel-quarkus-pdf -->
<!--<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-pdf</artifactId>
<version>3.6.0</version>
</dependency>-->

<dependency>
<groupId>io.quarkiverse.minio</groupId>
<artifactId>quarkus-minio</artifactId>
<version>2.9.2</version>
</dependency>

<dependency>
<groupId>io.quarkiverse.minio</groupId>
<artifactId>quarkus-minio</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-undertow</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
Expand Down Expand Up @@ -112,7 +128,7 @@
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.5</version>
<version>9.6</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -181,11 +197,14 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>5.4.0</version>

<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.25.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -210,13 +229,20 @@
<dependency>
<groupId>io.quarkiverse.jdbc</groupId>
<artifactId>quarkus-jdbc-sqlite</artifactId>
<version>1.0.3</version>
<version>3.0.7</version>
</dependency>
<dependency>
<!--<dependency>
<groupId>org.jasig.cas.client</groupId>
<artifactId>cas-client-core</artifactId>
<version>${cas.version}</version>
</dependency>
</dependency>-->
<!-- https://mvnrepository.com/artifact/org.apereo.cas.client/cas-client-core -->
<dependency>
<groupId>org.apereo.cas.client</groupId>
<artifactId>cas-client-core</artifactId>
<version>4.0.3</version>
</dependency>

</dependencies>
<build>
<defaultGoal>compile quarkus:dev</defaultGoal>
Expand Down Expand Up @@ -274,7 +300,7 @@
</includeOnlyProperties>
</configuration>
</plugin>
<plugin>
<!-- <plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
Expand Down Expand Up @@ -302,7 +328,7 @@
</configuration>
</execution>
</executions>
</plugin>
</plugin>-->
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
Expand Down Expand Up @@ -351,9 +377,9 @@
</requireMavenVersion>
<requireJavaVersion>
<message>You are running an incompatible version of Java. JHipster Quarkus supports JDK
8 to
17.</message>
<version>[1.8,19)</version>
17 to
21.</message>
<version>[17,22)</version>
</requireJavaVersion>
</rules>
</configuration>
Expand All @@ -373,10 +399,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<systemProperties>
<jacoco-agent.destfile>${jacoco.utReportFile}</jacoco-agent.destfile>
<systemPropertyVariables>
<!-- <jacoco-agent.destfile>${jacoco.utReportFile}</jacoco-agent.destfile>-->
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
</systemProperties>
<maven.home>${maven.home}</maven.home>

</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
Expand Down
13 changes: 8 additions & 5 deletions src/main/docker/Dockerfile.build.amd64
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
FROM ghcr.io/graalvm/graalvm-ce:ol9-java11 AS build-step
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21 AS build-step
USER root
WORKDIR /app
RUN gu install native-image
# RUN gu install native-image
RUN microdnf install git -y
RUN git clone https://github.com/correctexam/corrigeExamBack
WORKDIR /app/corrigeExamBack
RUN git checkout develop
WORKDIR /app/corrigeExamBack

RUN mkdir -p /opt/maven
WORKDIR /opt/maven
RUN curl -O "https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz" && tar xzvf "apache-maven-3.6.3-bin.tar.gz" && rm "apache-maven-3.6.3-bin.tar.gz"
RUN curl -O "https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz" && tar xzvf "apache-maven-3.9.6-bin.tar.gz" && rm "apache-maven-3.9.6-bin.tar.gz"

WORKDIR /app/corrigeExamBack
RUN /opt/maven/apache-maven-3.6.3/bin/mvn package -Pnative
RUN /opt/maven/apache-maven-3.9.6/bin/mvn package -Pnative

FROM oraclelinux:9-slim as prod
FROM quay.io/quarkus/quarkus-micro-image:2.0-amd64 as prod
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# docker run -i --rm -p 8080:8080 quarkus/grade-scope-istic
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
FROM quay.io/quarkus/quarkus-micro-image:2.0-amd64
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fr/istic/config/FooDeserializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.lang.reflect.Type;
import java.util.Base64;

import javax.json.bind.serializer.DeserializationContext;
import javax.json.bind.serializer.JsonbDeserializer;
import javax.json.stream.JsonParser;
import jakarta.json.bind.serializer.DeserializationContext;
import jakarta.json.bind.serializer.JsonbDeserializer;
import jakarta.json.stream.JsonParser;

public class FooDeserializer implements JsonbDeserializer<byte[]> {

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fr/istic/config/FooSerializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import java.util.Base64;

import javax.json.bind.serializer.JsonbSerializer;
import javax.json.bind.serializer.SerializationContext;
import jakarta.json.bind.serializer.JsonbSerializer;
import jakarta.json.bind.serializer.SerializationContext;


public class FooSerializer implements JsonbSerializer<byte[]> {

@Override
public void serialize(byte[] obj, javax.json.stream.JsonGenerator generator, SerializationContext ctx) {
public void serialize(byte[] obj, jakarta.json.stream.JsonGenerator generator, SerializationContext ctx) {
Base64.Encoder encoder = Base64.getEncoder();
byte[] encodedContent = encoder.encode(obj);
generator.write( new String(encodedContent));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/istic/config/JsonbConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import io.quarkus.jsonb.JsonbConfigCustomizer;

import javax.inject.Singleton;
import javax.json.bind.JsonbConfig;
import jakarta.inject.Singleton;
import jakarta.json.bind.JsonbConfig;
import java.util.Locale;

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fr/istic/config/LocalDateProvider.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package fr.istic.config;

import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import jakarta.ws.rs.ext.ParamConverter;
import jakarta.ws.rs.ext.ParamConverterProvider;
import jakarta.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.time.LocalDate;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/istic/config/SPARouting.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.regex.Pattern;
import java.util.stream.Stream;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.event.Observes;

import io.vertx.ext.web.Router;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/istic/domain/Answer2HybridGradedComment.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import io.quarkus.hibernate.orm.panache.PanacheQuery;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.io.Serializable;
import javax.json.bind.annotation.JsonbTransient;
import javax.persistence.*;
import jakarta.json.bind.annotation.JsonbTransient;
import jakarta.persistence.*;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/fr/istic/domain/Authority.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.persistence.*;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.persistence.*;

/**
* An authority (a security role).
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/istic/domain/Comments.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package fr.istic.domain;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import javax.json.bind.annotation.JsonbTransient;
import jakarta.json.bind.annotation.JsonbTransient;
import io.quarkus.hibernate.orm.panache.PanacheQuery;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import jakarta.persistence.*;

import java.io.Serializable;
import java.util.List;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fr/istic/domain/Course.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package fr.istic.domain;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import javax.json.bind.annotation.JsonbTransient;
import jakarta.json.bind.annotation.JsonbTransient;
import io.quarkus.hibernate.orm.panache.PanacheQuery;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;
import jakarta.persistence.*;
import jakarta.validation.constraints.*;

import java.io.Serializable;
import java.util.HashSet;
Expand Down
Loading

0 comments on commit b442b96

Please sign in to comment.