Skip to content

Commit

Permalink
chore(deps): Update Gradle 8.4 and Micronaut
Browse files Browse the repository at this point in the history
  • Loading branch information
gabizou committed Nov 14, 2023
1 parent 04502a0 commit a740e0a
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_wrap_on_typing = false

[*.{yml,yaml}]
indent_size = 2

[*.java]
ij_continuation_indent_size = 4
ij_visual_guides = 80, 120
Expand Down
102 changes: 59 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,70 +7,86 @@ downloads website.

## Requirements

- Java 16
- Java 21 (GraalVM optional to build native images)
- Docker
- sbt 1.15
- terraform (if you want to deploy to a kubernetes cluster)

## Technologies in use
### Micronaut 4.1.3

### Framework
- [User Guide](https://docs.micronaut.io/4.1.3/guide/index.html)
- [API Reference](https://docs.micronaut.io/4.1.3/api/index.html)
- [Configuration Reference](https://docs.micronaut.io/4.1.3/guide/configurationreference.html)
- [Micronaut Guides](https://guides.micronaut.io/index.html)
---

SystemOfADownload (SOAD) is built on [LagomFramework], an opinionated
[Event Source] + [CQRS] architecture framework built on [Akka], and as such relies
on several functional programing paradigms. Lagom as a whole provides enough
to build out several services with semi-automatic service discovery routing
and using [Postgres] as the primary storage database for the Event Journal and
Query side persistence.
- [Shadow Gradle Plugin](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow)
- [Micronaut Gradle Plugin documentation](https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/)
- [GraalVM Gradle Plugin documentation](https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html)
#### Feature test-resources documentation

To learn about the topics, please visit
[Lagom's documentation on concepts](https://www.lagomframework.com/documentation/1.6.x/java/CoreConcepts.html)
that goes at length about how the system works together.
- [Micronaut Test Resources documentation](https://micronaut-projects.github.io/micronaut-test-resources/latest/guide/)

### Containerization Out of the Box

SOAD is targeted at being deployed with either sbt in-development or deployed on a
Kubernetes cluster.
#### Feature r2dbc documentation

### Services
Each service is loosely intended on the desired workload/grouped boundaries of knowledge.
- [Micronaut R2DBC documentation](https://micronaut-projects.github.io/micronaut-r2dbc/latest/guide/)

In a sense, the data
The first three are what effectively being given as model views to exploring a paired
[Sonatype Nexus] repository instance for artifacts and presenting/serving them in a
more user friendlier way by providing git-like changelogs between artifacts.
- [https://r2dbc.io](https://r2dbc.io)

#### ArtifactService

The bread and butter of the shebang. Manages/creates/caches artifacts to knowledge by
[maven coordindates](https://maven.apache.org/pom.html#Maven_Coordinates). Typically,
an `Artifact` is not actually an artifact, but considered a `Component` with several
`Asset`s. Here we have exposed the ability to retrieve an artifact (if registered) and
its known assets along with download url's provided.
#### Feature github-workflow-graal-docker-registry documentation

#### CommitService
- [https://docs.github.com/en/free-pro-team@latest/actions](https://docs.github.com/en/free-pro-team@latest/actions)

This is a little more subtle, but effectively, since each artifact may or may not have a
`Git-Commit` listed in the jar manifest, this service strictly deals with managing registered
repositories, updating them, and pulling the list of commits diffing between two commits.

#### ChangelogService
#### Feature security-ldap documentation

Amalgamation of information between the `ArtifactService` and `CommitService`. This is where
we can store/manage changelogs per artifact regsitered by an entity.
- [Micronaut Security LDAP documentation](https://micronaut-projects.github.io/micronaut-security/latest/guide/index.html#ldap)

#### SonatypeWebhookService

This is the webhook functionality that performs a [Saga]-like series of jobs or units of
work. Because the nature of an artifact being uploaded to Sonatype and "the fact that anything
can and will go wrong",
#### Feature discovery-kubernetes documentation

- [Micronaut Kubernetes Service Discovery documentation](https://micronaut-projects.github.io/micronaut-kubernetes/latest/guide/#service-discovery)


#### Feature micronaut-aot documentation

- [Micronaut AOT documentation](https://micronaut-projects.github.io/micronaut-aot/latest/guide/)


#### Feature liquibase documentation

- [Micronaut Liquibase Database Migration documentation](https://micronaut-projects.github.io/micronaut-liquibase/latest/guide/index.html)

- [https://www.liquibase.org/](https://www.liquibase.org/)


#### Feature cache-caffeine documentation

- [Micronaut Caffeine Cache documentation](https://micronaut-projects.github.io/micronaut-cache/latest/guide/index.html)

- [https://github.com/ben-manes/caffeine](https://github.com/ben-manes/caffeine)


#### Feature serialization-jackson documentation

- [Micronaut Serialization Jackson Core documentation](https://micronaut-projects.github.io/micronaut-serialization/latest/guide/)


#### Feature data-r2dbc documentation

- [Micronaut Data R2DBC documentation](https://micronaut-projects.github.io/micronaut-data/latest/guide/#dbc)

- [https://r2dbc.io](https://r2dbc.io)


#### Feature jdbc-hikari documentation

- [Micronaut Hikari JDBC Connection Pool documentation](https://micronaut-projects.github.io/micronaut-sql/latest/guide/index.html#jdbc)


### AuthService

Provides the login end point and generates Json Web Tokens (JWTs) to enable interacting
with select services. It uses lagom-pac4j's [`SecuredService`] to provide authentication
and authorization to other endpoints. It is used to provide internal, LDAP and JWT based
authentication.

[LagomFramework]:https://lagomframework.com/
[Event Source]:https://docs.microsoft.com/en-us/azure/architecture/patterns/event-sourcing
Expand Down
15 changes: 11 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
id("io.micronaut.library") version "4.0.2" apply false
id("io.micronaut.application") version "4.0.2" apply false
id("io.micronaut.docker") version "4.0.2" apply false
id("io.micronaut.aot") version "4.0.2" apply false
id("io.micronaut.test-resources") version "4.0.2" apply false
}

Expand Down Expand Up @@ -36,15 +37,21 @@ tasks {
}
}


tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}


allprojects {
apply(plugin = "java-library")

java {
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
if (JavaVersion.current() < JavaVersion.VERSION_20) {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
if (JavaVersion.current() < JavaVersion.VERSION_21) {
toolchain {
languageVersion.set(JavaLanguageVersion.of(20))
languageVersion.set(JavaLanguageVersion.of(21))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
micronaut = "4.0.5"
micronaut = "4.1.3"
scala = "2.13"
akka = "2.8.5"
jackson = "2.15.3"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down

0 comments on commit a740e0a

Please sign in to comment.