diff --git a/.github/workflows/appmap-analysis.yml b/.github/workflows/appmap-analysis.yml new file mode 100644 index 00000000..5cb28384 --- /dev/null +++ b/.github/workflows/appmap-analysis.yml @@ -0,0 +1,46 @@ +name: appmap-analysis + +on: + pull_request: + push: + branches: + - main # Change this to the name of the mainline branch + schedule: + - cron: '0 0 * * 0' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: 'wget https://github.com/docker/compose/releases/download/v2.22.0/docker-compose-linux-x86_64' + - run: 'sudo mv docker-compose-linux-x86_64 /usr/libexec/docker/cli-plugins/docker-compose' + - run: 'sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose' + + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + cache: maven + + - name: Maven Test + run: ./mvnw test + + - name: Save AppMaps + uses: actions/cache/save@v3 + if: always() + with: + path: ./tmp/appmap + key: appmaps-${{ github.sha }}-${{ github.run_attempt }} + + appmap-analysis: + if: always() + needs: [test] # You may need to change this to match the name of the step that runs your tests. + uses: getappmap/analyze-action/.github/workflows/appmap-analysis.yml@v1 + permissions: + actions: read + contents: read + checks: write + pull-requests: write diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9de1fb78 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: build + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: 'wget https://github.com/docker/compose/releases/download/v2.22.0/docker-compose-linux-x86_64' + - run: 'sudo mv docker-compose-linux-x86_64 /usr/libexec/docker/cli-plugins/docker-compose' + - run: 'sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose' + + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + cache: maven + + - name: Maven Test + run: ./mvnw test diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml deleted file mode 100644 index 5de223fc..00000000 --- a/.github/workflows/maven-build.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ '17' ] - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK ${{matrix.java}} - uses: actions/setup-java@v2 - with: - java-version: ${{matrix.java}} - distribution: 'adopt' - cache: maven - - name: Build with Maven Wrapper - run: ./mvnw -B package diff --git a/.gitignore b/.gitignore index af0cb9bb..f4ac6d51 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,10 @@ build/* _site/ *.css !petclinic.css + + +# AppMap artifacts +/.appmap + +# Node modules +/node_modules \ No newline at end of file diff --git a/appmap.yml b/appmap.yml new file mode 100644 index 00000000..892baf88 --- /dev/null +++ b/appmap.yml @@ -0,0 +1,5 @@ +name: sample_spring_app +packages: + - path: org.springframework.samples.petclinic +language: java +appmap_dir: tmp/appmap diff --git a/pom.xml b/pom.xml index 809e2db5..adf059d5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,3 @@ - 4.0.0 org.springframework.samples @@ -276,7 +275,20 @@ - + + com.appland + appmap-maven-plugin + 1.3.0 + + + process-test-classes + + prepare-agent + + + + + @@ -405,7 +417,7 @@ - + @@ -418,7 +430,7 @@ - + @@ -431,7 +443,7 @@ - + @@ -444,4 +456,4 @@ - + \ No newline at end of file diff --git a/readme.md b/readme.md index 80d80090..782add60 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ - + ## Understanding the Spring Petclinic application with a few diagrams See the presentation here diff --git a/src/main/java/org/springframework/samples/petclinic/vet/Vet.java b/src/main/java/org/springframework/samples/petclinic/vet/Vet.java index 7a70155c..fc43f08a 100644 --- a/src/main/java/org/springframework/samples/petclinic/vet/Vet.java +++ b/src/main/java/org/springframework/samples/petclinic/vet/Vet.java @@ -46,6 +46,7 @@ public class Vet extends Person { @ManyToMany(fetch = FetchType.EAGER) + @JoinTable(name = "vet_specialties", joinColumns = @JoinColumn(name = "vet_id"), inverseJoinColumns = @JoinColumn(name = "specialty_id")) private Set specialties;