Skip to content

Commit

Permalink
Reimplement Causeway 4.0 in Quarkus
Browse files Browse the repository at this point in the history
  • Loading branch information
janinko committed Sep 3, 2024
1 parent 8fb2e6f commit 3783121
Show file tree
Hide file tree
Showing 125 changed files with 3,426 additions and 8,176 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ target/
.settings/

# Ignore this: autogenerated
core/src/main/java/org/jboss/pnc/causeway/config/constants/BuildInformationConstants.java
src/main/java/org/jboss/pnc/causeway/constants/BuildInformationConstants.java
33 changes: 0 additions & 33 deletions CHANGELOG.md

This file was deleted.

2 changes: 2 additions & 0 deletions LICENSE-header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright 2024 Red Hat, Inc.
SPDX-License-Identifier: Apache-2.0
70 changes: 45 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,56 @@
## Integration tests
Integration tests are run in phase integration-test. To run them use mvn verify.
# causeway

Tests are using by default url http://pnc-host/pnc-rest/rest to connect to PNC (you can define IP for pnc-host in your hosts file).
This project uses Quarkus, the Supersonic Subatomic Java Framework.

Alternatively you can set the value by setting system property PNC_URL (eg. -DPNC_URL=http://my-pnc-host/pnc-rest/rest)
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

## Disabling integration tests for PNC
Integration tests for PNC can be disabled by setting -Ddisable-pnc-it
## Running the application in dev mode

## Dependencies
To compile causeway you need to compile:
* https://github.com/project-ncl/pnc
* https://github.com/release-engineering/kojiji
You can run your application in dev mode that enables live coding using:
```shell script
mvn compile quarkus:dev
```

## Metrics support
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
PNC tracks metrics of JVM and its internals via Dropwizard Metrics. The metrics can currently be reported to a Graphite server by specifying as system property or environment variables those properties:
- metrics\_graphite\_server (mandatory)
- metrics\_graphite\_port (mandatory)
- metrics\_graphite\_prefix (mandatory)
- metrics\_graphite\_interval (optional)
## Packaging and running the application

If the `metrics_graphite_interval` variable (interval specified in seconds) is not specified, we'll use the default value of 60 seconds to report data to Graphite.
The application can be packaged using:
```shell script
mvn package
```
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.

The graphite reporter is configured to report rates per second and durations in terms of milliseconds.
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.

## OIDC Client Support
We need to setup an OIDC Client to send back callback information. This is done by defining in the main.conf the following values:
If you want to build an _über-jar_, execute the following command:
```shell script
mvn package -Dquarkus.package.jar.type=uber-jar
```

- `oidc-client.url`: Base URL of the Keycloak server
- `oidc-client.realm`: Realm used with Keycloak
- `oidc-client.client-id`: the client id name
- `oidc-client.secret-file`: the location of the file that contains the secret
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.

Only client credentials flow is supported for now.
## Creating a native executable

You can create a native executable using:
```shell script
mvn package -Dnative
```

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
```shell script
mvn package -Dnative -Dquarkus.native.container-build=true
```

You can then execute your native executable with: `./target/causeway-1.0.0-SNAPSHOT-runner`

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.

## Provided Code

### REST

Easily start your REST Web Services

[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources)
130 changes: 0 additions & 130 deletions application/pom.xml

This file was deleted.

45 changes: 0 additions & 45 deletions application/src/main/application/META-INF/application.xml

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions application/src/main/conf/main.conf

This file was deleted.

Loading

0 comments on commit 3783121

Please sign in to comment.