Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Dirigible from Spring Boot 2.7.18 to 3.2.0 #11

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
722cbc5
initial commit
iliyan-velichkov Dec 11, 2023
888c2de
add httpclient versions
iliyan-velichkov Dec 11, 2023
0067c4a
use jakarta packages
iliyan-velichkov Dec 11, 2023
060436c
adapt spring security
iliyan-velichkov Dec 11, 2023
97e4844
fix mail client
iliyan-velichkov Dec 11, 2023
95cbc2a
disable odata module for now
iliyan-velichkov Dec 11, 2023
b3e37d6
more adaptations
iliyan-velichkov Dec 11, 2023
e8a2737
disable odata
iliyan-velichkov Dec 11, 2023
9a0c6b4
more adaptations
iliyan-velichkov Dec 11, 2023
b70e84c
use newer interface
iliyan-velichkov Dec 11, 2023
8222340
minor fixes
iliyan-velichkov Dec 11, 2023
5a9cf0d
remove plugin versions
iliyan-velichkov Dec 11, 2023
c547dfe
fix EncryptionBeanPostProcessor
iliyan-velichkov Dec 11, 2023
5f2c19b
remove dep versions
iliyan-velichkov Dec 11, 2023
b8f8c70
disable odata
iliyan-velichkov Dec 11, 2023
fd81ac9
camel 3.21.2
iliyan-velichkov Dec 11, 2023
394c9ba
fix activemq dependencies version
iliyan-velichkov Dec 12, 2023
9187527
adapt Camel
iliyan-velichkov Dec 12, 2023
53bda24
adapt tests
iliyan-velichkov Dec 12, 2023
25b971d
add synchronized
iliyan-velichkov Dec 12, 2023
310fc3e
dummy KeycloakSecurityConfiguration
iliyan-velichkov Dec 12, 2023
a009298
fix integration tests
iliyan-velichkov Dec 12, 2023
e0cd9f6
fix javadoc plugin issue
iliyan-velichkov Dec 12, 2023
2ec8909
use migrated olingo dependency
iliyan-velichkov Dec 14, 2023
a99af45
Update README.md
iliyan-velichkov Dec 14, 2023
ac0ab12
fix startup errors
iliyan-velichkov Dec 15, 2023
07726e8
centralized plugins management
iliyan-velichkov Dec 15, 2023
4658ef8
maven compiler plugin centralized config
iliyan-velichkov Dec 15, 2023
189a173
maven-compiler-plugin in parent
iliyan-velichkov Dec 15, 2023
159535a
centralized formatter-maven-plugin
iliyan-velichkov Dec 15, 2023
c9dac53
set fixed plugins version
iliyan-velichkov Dec 15, 2023
43d257f
improve logging
iliyan-velichkov Dec 15, 2023
7afb67f
use olingo from the codbex fork repo
iliyan-velichkov Dec 17, 2023
799bb97
fix javadoc error
iliyan-velichkov Dec 17, 2023
1f686ac
integration tests on ubuntu as well
iliyan-velichkov Dec 17, 2023
998a988
Update pull-request.yml
iliyan-velichkov Dec 17, 2023
a094956
remove provided scopes
iliyan-velichkov Dec 18, 2023
cec41db
add keycloak conifugations
iliyan-velichkov Dec 18, 2023
9b2a662
rebase
iliyan-velichkov Dec 18, 2023
4c63065
remove dependencyManagement
iliyan-velichkov Dec 18, 2023
b12bef7
fix javadoc generation
iliyan-velichkov Dec 18, 2023
7834e6f
native images support
iliyan-velichkov Dec 19, 2023
da82f72
fix OData
iliyan-velichkov Dec 19, 2023
a726694
javax replacements
iliyan-velichkov Dec 19, 2023
e6cc74f
pom cleanup
iliyan-velichkov Dec 19, 2023
26b9f75
fix cxf conflict
iliyan-velichkov Dec 19, 2023
7abee88
describe how to build native image
iliyan-velichkov Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ bin/
.history
.vscode
node_modules
build/
**/build
build/application/dirigible
!/build

# files
.DS_Store
Expand Down
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The project started as an internal SAP initiative to address the extension and a
- [Run](#run)
- [Standalone](#standalone)
- [Docker](#docker)
- [Native image](#native-image)
- [Code formatting](#code-formatting)
- [Additional Information](#additional-information)
- [License](#license)
Expand Down Expand Up @@ -147,7 +148,6 @@ More info about **ttyd** can be found at: [ttyd](https://github.com/tsl0922/ttyd
5. Login with user: `admin` and password `admin`
6. REST API description in an OpenAPI format can be found at: [http://localhost:8080/swagger-ui/index.html](http://localhost:8080/swagger-ui/index.html "http://localhost:8080/swagger-ui/index.html")


#### Docker

##### Prerequisites
Expand Down Expand Up @@ -176,6 +176,27 @@ More info about **ttyd** can be found at: [ttyd](https://github.com/tsl0922/ttyd

4. Optionally you can enhance and customize the Dockerfile from [here](https://github.com/eclipse/dirigible/blob/master/build/application/Dockerfile)

#### Native image
##### Prerequisites
- [Install SDKMAN](https://sdkman.io)
- Install GraalVM: `sdk install java 21.0.1-graal`
- Make sure that `JAVA_HOME` and `PATH` env variables point to your graalvm jdk from the previous step

##### Steps
- Execute the following on your github repo root folder
```
# build dirigible fat jar
mvn -T 1C clean install -D maven.test.skip=true -D skipTests -D maven.javadoc.skip=true -D license.skip=true

rm -rf dirigible

# build native image
native-image -jar 'build/application/target/dirigible-application-10.0.0-SNAPSHOT-executable.jar' -o dirigible

# start dirigible
./dirigible
```

#### PostgreSQL

##### Steps
Expand Down Expand Up @@ -264,4 +285,3 @@ Unicons by IconScout: [https://github.com/Iconscout/unicons](https://github.com/
- Mailing List: [https://dev.eclipse.org/mailman/listinfo/dirigible-dev](https://dev.eclipse.org/mailman/listinfo/dirigible-dev)
- Issues: [https://github.com/eclipse/dirigible/issues](https://github.com/eclipse/dirigible/issues)
- Eclipse Foundation Help Desk: https://gitlab.eclipse.org/eclipsefdn/helpdesk

14 changes: 2 additions & 12 deletions build/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<packaging>jar</packaging>

<dependencies>

<!-- Platform -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -114,7 +113,6 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2database.version}</version>
</dependency>

<!-- WebJars -->
Expand All @@ -126,16 +124,10 @@

<!-- Olingo -->
<dependency>
<groupId>org.apache.olingo</groupId>
<groupId>com.codbex.olingo</groupId>
<artifactId>olingo-odata2-lib</artifactId>
<version>${olingo.version}</version>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Core -->
Expand Down Expand Up @@ -212,7 +204,7 @@
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-database-mongodb-jdbc</artifactId>
Expand Down Expand Up @@ -255,7 +247,6 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<mainClass>org.eclipse.dirigible.DirigibleApplication</mainClass>
</configuration>
Expand All @@ -273,7 +264,6 @@
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>${git-commit-id-plugin.version}</version>
<executions>
<execution>
<id>get-the-git-infos</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ public static void main(String[] args) {
}

@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}

@EventListener
public void onStartup(ApplicationReadyEvent event) {
void onStartup(@SuppressWarnings("unused") ApplicationReadyEvent event) {
LOGGER.info("------------------------ Dirigible started ------------------------");
}

@EventListener
public void onShutdown(ContextClosedEvent event) {
void onShutdown(@SuppressWarnings("unused") ContextClosedEvent event) {
LOGGER.info("------------------------ Dirigible stopped ------------------------");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
basic.enabled=false

# example https://keycloak.apps.dirigible.io/auth/realms/dirigible
spring.security.oauth2.client.provider.keycloak.issuer-uri=${DIRIGIBLE_KEYCLOAK_AUTH_SERVER_URL}

spring.security.oauth2.client.registration.keycloak.provider=keycloak
spring.security.oauth2.client.registration.keycloak.client-id=${DIRIGIBLE_KEYCLOAK_CLIENT_ID}
spring.security.oauth2.client.registration.keycloak.scope=openid,profile,roles,microprofile-jwt,email,phone,web-origins,address,offline_access
spring.security.oauth2.client.registration.keycloak.authorization-grant-type=authorization_code

spring.security.oauth2.client.provider.keycloak.user-name-attribute=preferred_username
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
basic.enabled=false

spring.security.oauth2.client.registration.github.clientId=${GITHUB_CLIENT_ID}
spring.security.oauth2.client.registration.github.clientSecret=${GITHUB_CLIENT_SECRET}
18 changes: 3 additions & 15 deletions build/application/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,12 @@ spring.mvc.async.request-timeout=3600000

basic.enabled=${DIRIGIBLE_BASIC_ENABLED:true}

keycloak.enabled=${DIRIGIBLE_KEYCLOAK_ENABLED:false}
keycloak.realm=${DIRIGIBLE_KEYCLOAK_REALM:null}
keycloak.auth-server-url=${DIRIGIBLE_KEYCLOAK_AUTH_SERVER_URL:null}
keycloak.ssl-required=${DIRIGIBLE_KEYCLOAK_SSL_REQUIRED:external}
keycloak.resource=${DIRIGIBLE_KEYCLOAK_CLIENT_ID:null}
keycloak.public-client=true
keycloak.principal-attribute=preferred_username
keycloak.confidential-port=${DIRIGIBLE_KEYCLOAK_CONFIDENTIAL_PORT:443}
keycloak.use-resource-role-mappings=true

oauth2.enabled=${DIRIGIBLE_OAUTH2_ENABLED:false}
spring.security.oauth2.client.registration.github.clientId=${GITHUB_CLIENT_ID}
spring.security.oauth2.client.registration.github.clientSecret=${GITHUB_CLIENT_SECRET}

terminal.enabled=${DIRIGIBLE_TERMINAL_ENABLED:false}

management.metrics.mongo.command.enabled=false
management.metrics.mongo.connectionpool.enabled=false

spring.devtools.restart.poll-interval=6s
spring.devtools.restart.quiet-period=5s
spring.devtools.restart.quiet-period=5s

cxf.path=/odata/v2
4 changes: 2 additions & 2 deletions build/application/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<appender-ref ref="ConsoleLoggingAppender" />
</logger>

<logger name="app" level="ALL" additivity="false">
<logger name="app" level="INFO" additivity="false">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE_APPS" />
<appender-ref ref="ConsoleLoggingAppender" />
Expand All @@ -69,6 +69,6 @@
<appender-ref ref="ConsoleLoggingAppender" />
</root>

<logger name="org.eclipse.dirigible.components.initializers.synchronizer" level="ALL"/>
<logger name="org.eclipse.dirigible.components.initializers.synchronizer" level="INFO"/>

</configuration>
16 changes: 5 additions & 11 deletions build/helm-charts/dirigible/templates/dirigible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,21 @@ spec:
value: "true"
{{- end }}
{{- if .Values.keycloak.enabled }}
- name: DIRIGIBLE_KEYCLOAK_ENABLED
value: "true"
- name: spring_profiles_active
value: "keycloak"
- name: DIRIGIBLE_BASIC_ENABLED
value: "false"
- name: DIRIGIBLE_KEYCLOAK_CONFIDENTIAL_PORT
value: "443"
- name: DIRIGIBLE_KEYCLOAK_SSL_REQUIRED
value: "none"
- name: DIRIGIBLE_KEYCLOAK_REALM
value: {{ required "Missing Keycloak realm" .Values.keycloak.realm }}
- name: DIRIGIBLE_KEYCLOAK_CLIENT_ID
value: {{ required "Missing Keycloak client id" .Values.keycloak.clientId }}
{{- if .Values.ingress.enabled }}
- name: DIRIGIBLE_KEYCLOAK_AUTH_SERVER_URL
value: http{{ if $.Values.ingress.tls }}s{{ end }}://{{ required "Missing Keycloak name" .Values.keycloak.name }}.{{ required "Missing ingress host" .Values.ingress.host }}/auth/
value: http{{ if $.Values.ingress.tls }}s{{ end }}://{{ required "Missing Keycloak name" .Values.keycloak.name }}.{{ required "Missing ingress host" .Values.ingress.host }}/auth/realms/{{ required "Missing Keycloak realm" .Values.keycloak.realm }}
{{- else if .Values.istio.enabled }}
- name: DIRIGIBLE_KEYCLOAK_AUTH_SERVER_URL
value: http{{ if $.Values.ingress.tls }}s{{ end }}://{{ required "Missing Keycloak name" .Values.keycloak.name }}.{{ required "Missing ingress host" .Values.ingress.host }}/auth/
value: http{{ if $.Values.ingress.tls }}s{{ end }}://{{ required "Missing Keycloak name" .Values.keycloak.name }}.{{ required "Missing ingress host" .Values.ingress.host }}/auth/realms/{{ required "Missing Keycloak realm" .Values.keycloak.realm }}
{{- else }}
- name: DIRIGIBLE_KEYCLOAK_AUTH_SERVER_URL
value: https://{{ required "Missing Keycloak name" .Values.keycloak.name }}/auth/
value: https://{{ required "Missing Keycloak name" .Values.keycloak.name }}/auth/realms/{{ required "Missing Keycloak realm" .Values.keycloak.realm }}
{{- end }}
{{- end }}
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.HashSet;
import java.util.Set;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;

import org.eclipse.dirigible.commons.config.Configuration;
import org.eclipse.dirigible.components.api.http.HttpRequestFacade;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.Map;
import java.util.Properties;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.eclipse.dirigible.commons.api.helpers.GsonHelper;
import org.eclipse.dirigible.commons.config.Configuration;
import org.eclipse.dirigible.repository.api.IRepository;
Expand Down Expand Up @@ -102,7 +99,8 @@ public static String get(String name) throws NoSuchMethodException, SecurityExce
} else {
throw new IllegalArgumentException(String.format("Destination: %s does not exist", fullName));
}
} else if (DIRIGIBLE_DESTINATIONS_PROVIDER_MANAGED.equals(destinationProvider)) {
}
if (DIRIGIBLE_DESTINATIONS_PROVIDER_MANAGED.equals(destinationProvider)) {
Map destinationProperties = initializeFromDestination(name);
return GsonHelper.toJson(destinationProperties);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import java.util.Map;
import org.eclipse.dirigible.components.base.helpers.JsonHelper;
import org.eclipse.dirigible.components.data.store.DataStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
Expand All @@ -27,14 +25,11 @@
@Component
public class DataStoreFacade implements InitializingBean {

/** The Constant logger. */
private static final Logger logger = LoggerFactory.getLogger(DataStoreFacade.class);

/** The data sore facade. */
private static DataStoreFacade INSTANCE;

/** The data store. */
private DataStore dataStore;
private final DataStore dataStore;

/**
* Instantiates a new data store facade.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,10 @@ private static void setParameters(String parameters, PreparedStatement preparedS
.getAsString()));
} catch (NumberFormatException e) {
// assume date string in ISO format e.g. 2018-05-22T21:00:00.000Z
value = new Date(javax.xml.bind.DatatypeConverter.parseDateTime(valueElement.getAsJsonPrimitive()
.getAsString())
.getTime()
.getTime());
value = new Date(jakarta.xml.bind.DatatypeConverter.parseDateTime(valueElement.getAsJsonPrimitive()
.getAsString())
.getTime()
.getTime());
}
preparedStatement.setDate(i++, value);
} else {
Expand All @@ -498,10 +498,10 @@ private static void setParameters(String parameters, PreparedStatement preparedS
.getAsString()));
} catch (NumberFormatException e) {
// assume XSDTime
value = new Time(javax.xml.bind.DatatypeConverter.parseTime(valueElement.getAsJsonPrimitive()
.getAsString())
.getTime()
.getTime());
value = new Time(jakarta.xml.bind.DatatypeConverter.parseTime(valueElement.getAsJsonPrimitive()
.getAsString())
.getTime()
.getTime());
}
preparedStatement.setTime(i++, value);
} else {
Expand All @@ -521,10 +521,10 @@ private static void setParameters(String parameters, PreparedStatement preparedS
.getAsString()));
} catch (NumberFormatException e) {
// assume date string in ISO format e.g. 2018-05-22T21:00:00.000Z
value = new Timestamp(javax.xml.bind.DatatypeConverter.parseDateTime(valueElement.getAsJsonPrimitive()
.getAsString())
.getTime()
.getTime());
value = new Timestamp(jakarta.xml.bind.DatatypeConverter.parseDateTime(valueElement.getAsJsonPrimitive()
.getAsString())
.getTime()
.getTime());
}
preparedStatement.setTimestamp(i++, value);
} else {
Expand Down
Loading
Loading