Skip to content

Commit

Permalink
Merge pull request #6 from mraible/agile-lnl
Browse files Browse the repository at this point in the history
Agile LnL demo with JHipster 8.7.1
  • Loading branch information
mraible authored Oct 8, 2024
2 parents 9dc656c + a7e3a83 commit 56206c2
Show file tree
Hide file tree
Showing 765 changed files with 30,172 additions and 30,102 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This repo contains the demo for my Micro Frontends for Java Microservices talk.

Events:

- [Agile LnL: October 8, 2024](https://speakerdeck.com/mraible/micro-frontends-for-java-microservices-agilelnl-2024)
- [dev2next: October 1, 2024](https://speakerdeck.com/mraible/micro-frontends-for-java-microservices-dev2next-2024)
- [KC/DC: June 27, 2024](https://speakerdeck.com/mraible/micro-frontends-for-java-microservices-kcdc-2024)
- [Utah JUG: April 18, 2024](https://speakerdeck.com/mraible/micro-frontends-for-java-microservices-utah-jug-2024)
Expand Down
4 changes: 2 additions & 2 deletions blog/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"VARIANT": "17-bullseye",
// Options
// maven and gradle wrappers are used by default, we don't need them installed globally
// "INSTALL_MAVEN": "true",
// "INSTALL_GRADLE": "false",
// "INSTALL_MAVEN": "false",
// "INSTALL_GRADLE": "true",
"NODE_VERSION": "20.17.0"
}
},
Expand Down
2 changes: 1 addition & 1 deletion blog/.jhipster/Blog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"annotations": {
"changelogDate": "20241001153637"
"changelogDate": "20241008173412"
},
"applications": ["blog"],
"clientRootFolder": "blog",
Expand Down
2 changes: 1 addition & 1 deletion blog/.jhipster/Post.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"annotations": {
"changelogDate": "20241001153737"
"changelogDate": "20241008173512"
},
"applications": ["blog"],
"clientRootFolder": "blog",
Expand Down
2 changes: 1 addition & 1 deletion blog/.jhipster/Tag.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"annotations": {
"changelogDate": "20241001153837"
"changelogDate": "20241008173612"
},
"applications": ["blog"],
"clientRootFolder": "blog",
Expand Down
1 change: 0 additions & 1 deletion blog/.mvn/jvm.config

This file was deleted.

Binary file removed blog/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 0 additions & 18 deletions blog/.mvn/wrapper/maven-wrapper.properties

This file was deleted.

10 changes: 0 additions & 10 deletions blog/.postcssrc.js

This file was deleted.

9 changes: 5 additions & 4 deletions blog/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ node_modules
package-lock.json
.git

# Generated by jhipster:maven
target
.mvn
# Generated by jhipster:gradle
build
gradle
.gradle

# Generated by jhipster:client
target/classes/static/
build/resources/main/static/
8 changes: 4 additions & 4 deletions blog/.yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"applicationType": "microservice",
"authenticationType": "oauth2",
"baseName": "blog",
"buildTool": "maven",
"clientFramework": "vue",
"buildTool": "gradle",
"clientFramework": "react",
"databaseType": "neo4j",
"devServerPort": 9061,
"enableHibernateCache": false,
"entities": ["Blog", "Post", "Tag"],
"jhipsterVersion": "8.7.1",
"jwtSecretKey": "OWI4YTdjNjYwZDI5ZjkyYjcyZTI1YjcwNTNhODhlZjU3YTZmNDQ5ZWJmNTY2YTQ3ZGNkMGI1ZjU4NjdkNTYxYjQxMDE0YzQ1MDBkNTIwNTMyODVkMjFiNjQ5M2QyYjVmMTFhYjJmZGRmYTEzZDM2ZDE3NDRiNDQ5YjNjNThlNTA=",
"jwtSecretKey": "ZjI3MTY5OTFkZTJlYjYwZGZiODNmMzY4ZTJiNGY5MzNjYjY4M2Q3MWRhNjUzZjgwZTYxZTY3MzRlYTM4Mjc0NDU5YTcxOTcwNDQxNzYxZjM1NDhiYmRlMjI3ODdhMmMxNDVlZDE4YTdjNDIxMDEyNTUyNjM5Y2U1ODJhMGZmZDA=",
"languages": ["en"],
"lastLiquibaseTimestamp": 1727797117000,
"lastLiquibaseTimestamp": 1728408972000,
"monorepository": true,
"nativeLanguage": "en",
"packageName": "org.jhipster.blog",
Expand Down
24 changes: 9 additions & 15 deletions blog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Run the following commands in two separate terminals to create a blissful develo
auto-refreshes when files change on your hard drive.
```
./mvnw
./gradlew -x webapp
./npmw start
```
Expand Down Expand Up @@ -283,14 +283,14 @@ cd microfrontend
To build the final jar and optimize the blog application for production, run:

```
./mvnw -Pprod clean verify
./gradlew -Pprod clean bootJar
```

This will concatenate and minify the client CSS and JavaScript files. It will also modify `index.html` so it references these new files.
To ensure everything worked, run:

```
java -jar target/*.jar
java -jar build/libs/*.jar
```

Then navigate to [http://localhost:8081](http://localhost:8081) in your browser.
Expand All @@ -302,7 +302,7 @@ Refer to [Using JHipster in production][] for more details.
To package your application as a war in order to deploy it to an application server, run:

```
./mvnw -Pprod,war clean verify
./gradlew -Pprod -Pwar clean bootWar
```

### JHipster Control Center
Expand All @@ -320,7 +320,7 @@ docker compose -f src/main/docker/jhipster-control-center.yml up
To launch your application's tests, run:

```
./mvnw verify
./gradlew test integrationTest jacocoTestReport
```

### Client tests
Expand All @@ -332,13 +332,13 @@ Unit tests are run by [Jest][]. They're located in [src/test/javascript/](src/te
```

UI end-to-end tests are powered by [Cypress][]. They're located in [src/test/javascript/cypress](src/test/javascript/cypress)
and can be run by starting Spring Boot in one terminal (`./mvnw spring-boot:run`) and running the tests (`./npmw run e2e`) in a second one.
and can be run by starting Spring Boot in one terminal (`./gradlew bootRun`) and running the tests (`./npmw run e2e`) in a second one.

#### Lighthouse audits

You can execute automated [Lighthouse audits](https://developers.google.com/web/tools/lighthouse/) with [cypress-audit](https://github.com/mfrachet/cypress-audit) by running `./npmw run e2e:cypress:audits`.
You should only run the audits when your application is packaged with the production profile.
The lighthouse report is created in `target/cypress/lhreport.html`
The lighthouse report is created in `build/cypress/lhreport.html`

## Others

Expand All @@ -352,18 +352,12 @@ docker compose -f src/main/docker/sonar.yml up -d

Note: we have turned off forced authentication redirect for UI in [src/main/docker/sonar.yml](src/main/docker/sonar.yml) for out of the box experience while trying out SonarQube, for real use cases turn it back on.

You can run a Sonar analysis with using the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) or by using the maven plugin.
You can run a Sonar analysis with using the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) or by using the gradle plugin.

Then, run a Sonar analysis:

```
./mvnw -Pprod clean verify sonar:sonar -Dsonar.login=admin -Dsonar.password=admin
```

If you need to re-run the Sonar phase, please be sure to specify at least the `initialize` phase since Sonar properties are loaded from the sonar-project.properties file.

```
./mvnw initialize sonar:sonar -Dsonar.login=admin -Dsonar.password=admin
./gradlew -Pprod clean check jacocoTestReport sonarqube -Dsonar.login=admin -Dsonar.password=admin
```

Additionally, Instead of passing `sonar.password` and `sonar.login` as CLI arguments, these parameters can be configured from [sonar-project.properties](sonar-project.properties) as shown below:
Expand Down
179 changes: 179 additions & 0 deletions blog/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
plugins {
id "java"
id "maven-publish"
id "idea"
id "eclipse"
id "com.gorylenko.gradle-git-properties"
alias(libs.plugins.spring.boot)
id "jhipster.spring-cache-conventions"
id "jhipster.docker-conventions"
id "jhipster.code-quality-conventions"
id "jhipster.node-gradle-conventions"
// jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
}

group = "org.jhipster.blog"
version = "0.0.1-SNAPSHOT"

description = ""

sourceCompatibility=17
targetCompatibility=17
assert System.properties["java.specification.version"] == "17" || "21" || "22"

ext {
springProfiles = ""
if (project.hasProperty("tls")) {
springProfiles += ",tls"
}
if (project.hasProperty("e2e")) {
springProfiles += ",e2e"
}
}

repositories {
// Local maven repository is required for libraries built locally with maven like development jhipster-bom.
// mavenLocal()
mavenCentral()
// jhipster-needle-gradle-repositories - JHipster will add additional repositories
}

apply plugin: 'io.spring.dependency-management'

// jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here

if (project.hasProperty("prod")) {
apply from: "gradle/profile_prod.gradle"
} else {
apply from: "gradle/profile_dev.gradle"
}

if (project.hasProperty("war")) {
apply from: "gradle/war.gradle"
}

if (project.hasProperty("zipkin")) {
apply from: "gradle/zipkin.gradle"
}

idea {
module {
excludeDirs += files("node_modules")
}
}

eclipse {
sourceSets {
main {
java {
srcDirs += ["build/generated/sources/annotationProcessor/java/main"]
}
}
}
}

defaultTasks "bootRun"

springBoot {
mainClass = "org.jhipster.blog.BlogApp"
}

test {
useJUnitPlatform()
exclude "**/*IT*", "**/*IntTest*"
testLogging {
events 'FAILED', 'SKIPPED'
}
jvmArgs += '-Djava.security.egd=file:/dev/./urandom -Xmx512m'
// uncomment if the tests reports are not generated
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
// ignoreFailures true
reports.html.required = false
testLogging.exceptionFormat "full"
}

check.dependsOn integrationTest
task testReport(type: TestReport) {
destinationDirectory = file("$buildDir/reports/tests")
testResults.from(test)
}

task integrationTestReport(type: TestReport) {
destinationDirectory = file("$buildDir/reports/tests")
testResults.from(integrationTest)
}

gitProperties {
failOnNoGitDirectory = false
keys = ["git.branch", "git.commit.id.abbrev", "git.commit.id.describe"]
}

tasks.withType(com.gorylenko.GenerateGitPropertiesTask).configureEach {
outputs.doNotCacheIf("Task is always executed") { true }
}

configurations {
providedRuntime
implementation.exclude module: "spring-boot-starter-tomcat"
}

dependencies {
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
implementation "com.github.ben-manes.caffeine:caffeine"
testImplementation("com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}") {
exclude group: "org.slf4j", module: "slf4j-api"
}
testRuntimeOnly("com.tngtech.archunit:archunit-junit5-engine:${archunitJunit5Version}") {
exclude group: "org.slf4j", module: "slf4j-api"
}
implementation "io.micrometer:micrometer-registry-prometheus-simpleclient"
implementation "jakarta.annotation:jakarta.annotation-api"
implementation "org.apache.commons:commons-lang3"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
implementation "org.springframework.boot:spring-boot-loader-tools"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-aop"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-mail"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
testImplementation "org.springframework.boot:spring-boot-starter-test"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation "org.springframework.boot:spring-boot-starter-undertow"
modules {
module("org.springframework.boot:spring-boot-starter-tomcat") {
replacedBy("org.springframework.boot:spring-boot-starter-undertow", "Use Undertow instead of Tomcat")
}
}
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-starter-web"
testImplementation "org.springframework.boot:spring-boot-test"
implementation "org.springframework.cloud:spring-cloud-starter"
implementation "org.springframework.cloud:spring-cloud-starter-bootstrap"
implementation "org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j"
implementation "org.springframework.cloud:spring-cloud-starter-consul-config"
implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
implementation "org.springframework.retry:spring-retry"
testImplementation "org.springframework.security:spring-security-test"
implementation platform(libs.spring.cloud.dependencies)
implementation libs.jhipster.framework
implementation libs.neo4j.migrations.spring.boot.starter
implementation libs.springdoc.openapi.starter.webmvc.api
implementation "org.springframework.boot:spring-boot-starter-data-neo4j"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:neo4j"
testImplementation "org.testcontainers:testcontainers"
developmentOnly "org.springframework.boot:spring-boot-docker-compose"
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
}

task cleanResources(type: Delete) {
delete "build/resources"
}


compileJava.dependsOn processResources
processResources.dependsOn bootBuildInfo
18 changes: 18 additions & 0 deletions blog/buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
id 'groovy-gradle-plugin'
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation libs.jib.plugin
implementation libs.modernizer.plugin
implementation libs.nohttp.plugin
implementation libs.sonarqube.plugin
implementation libs.spotless.plugin
implementation libs.node.gradle
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies for convention plugins here
// jhipster-needle-gradle-build-src-dependency - Deprecated: JHipster will add additional dependencies for convention plugins here
}
Loading

0 comments on commit 56206c2

Please sign in to comment.