diff --git a/.editorconfig b/.editorconfig index 32b9c28..1e81c1b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/README.md b/README.md index d0f9c98..4793023 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/artifacts/gradle/wrapper/gradle-wrapper.jar b/artifacts/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e583..0000000 Binary files a/artifacts/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/artifacts/gradle/wrapper/gradle-wrapper.properties b/artifacts/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index fae0804..0000000 --- a/artifacts/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/build.gradle.kts b/build.gradle.kts index aaf4fe2..f89287c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 } @@ -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)) } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fa7c304..19cedf4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -micronaut = "4.0.5" +micronaut = "4.1.3" scala = "2.13" akka = "2.8.5" jackson = "2.15.3" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..8838ba9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/gradlew b/gradlew index aeb74cb..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -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 @@ -130,10 +131,13 @@ 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. @@ -141,7 +145,7 @@ 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 @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | 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 @@ -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" \