DEV Community

Cover image for β˜•πŸš’ Maven Build in < 20 lines of yaml πŸ•Ÿ
Carlos Chacin β˜•πŸ‘½
Carlos Chacin β˜•πŸ‘½

Posted on β€’ Originally published at carloschac.in on

1

β˜•πŸš’ Maven Build in < 20 lines of yaml πŸ•Ÿ

GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.

Create the directory

$ mkdir -p .github/workflows
Enter fullscreen mode Exit fullscreen mode

Create the yaml file

$ touch .github/workflows/maven.yml
Enter fullscreen mode Exit fullscreen mode

Copy this content

name: Maven Build
on:
  push:
    branches:
      - main
jobs:
  build:
    name: "Maven Build"
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout Sources"
        uses: actions/checkout@v2
        with:
          fetch-depth: 2
      - name: "Set up JDK"
        uses: actions/setup-java@v2
        with:
          distribution: "temurin"
          java-version: 11
          cache: "maven"
      - name: "Build with Maven"
        run: mvn verify
Enter fullscreen mode Exit fullscreen mode

Commit and push to Github

$ git add .github && \
  git commit -m "maven build action"
Enter fullscreen mode Exit fullscreen mode

Enjoy your builds

Go to the actions tab for your repository over github.com:

https://github.com/${USER}/${PROJECT}/actions/workflows/maven-build.yml

maven-build

Image of Timescale

πŸš€ pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applicationsβ€”without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post β†’

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more