Skip to content

Commit

Permalink
#5: 👷 add Maven CI build; 👷 fix habushu resolution issue to enable te…
Browse files Browse the repository at this point in the history
…sting in clean .m2 repo
  • Loading branch information
d-ryan-ashcraft committed May 26, 2023
1 parent 2623bcc commit e5927c6
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
# TODO: update back to dev:
branches: [ "5-add-ci" ]
pull_request:
branches: [ "dev" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@v3
14 changes: 11 additions & 3 deletions fermenter-mda/pom.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<parent>
<groupId>org.technologybrewery.fermenter</groupId>
<artifactId>root</artifactId>
<version>2.9.0-SNAPSHOT</version>
</parent>

<name>Fermenter Model-Driven Architecture Code Generator</name>
<name>Fermenter::Model-Driven Architecture Code Generator</name>

<modelVersion>4.0.0</modelVersion>
<artifactId>fermenter-mda</artifactId>
<packaging>maven-plugin</packaging>

<properties>
<version.jackson>2.15.0</version.jackson>
<version.jackson>2.15.1</version.jackson>
<version.maven.core>3.8.6</version.maven.core>
<version.maven.plugin.tools>3.8.2</version.maven.plugin.tools>
<version.logback>1.4.7</version.logback>
Expand Down Expand Up @@ -136,6 +137,13 @@
<version>${version.logback}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- trigger download of habushu-maven-plugin so it is available for testing: -->
<groupId>org.technologybrewery.habushu</groupId>
<artifactId>habushu-maven-plugin</artifactId>
<version>2.4.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<plugin>
<groupId>org.technologybrewery.habushu</groupId>
<artifactId>habushu-maven-plugin</artifactId>
<version>2.4.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<plugin>
<groupId>org.technologybrewery.habushu</groupId>
<artifactId>habushu-maven-plugin</artifactId>
<version>2.4.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
</scm>

<modules>
<module>test-primer</module>
<module>fermenter-mda</module>
</modules>

Expand Down Expand Up @@ -178,4 +179,5 @@
</plugin>
</plugins>
</build>

</project>
35 changes: 35 additions & 0 deletions test-primer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.technologybrewery.fermenter</groupId>
<artifactId>root</artifactId>
<version>2.9.0-SNAPSHOT</version>
</parent>

<artifactId>test-primer</artifactId>
<name>Fermenter::Test Primer</name>
<description>A temp module to work around test dependency issues in fermenter-maven-plugin</description>

<!--
NB: Currently, the maven test harness needs access to a specific version of commons-io, among other dependencies,
but we leverage newer versions in fermenter-mda. As such, this is an ugly workaround that ensures that the
version is available in the .m2/repository of the local environment so that when the test runs, it
can be resolved. Because we are mocking the Maven plugin for testing, we cannot ignore or manually set
these dependencies via normal means.
-->

<build>
<plugins>
<plugin>
<groupId>org.technologybrewery.habushu</groupId>
<artifactId>habushu-maven-plugin</artifactId>
<version>2.4.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>

</project>

0 comments on commit e5927c6

Please sign in to comment.