Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for ☕🚢 Maven Build in < 20 lines of yaml 🕟
Carlos Chacin ☕👽
Carlos Chacin ☕👽

Posted on • Originally published atcarloschac.in on

     

☕🚢 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 modeExit fullscreen mode

Create the yaml file

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

Copy this content

name: Maven Buildon:  push:    branches:      - mainjobs:  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 modeExit fullscreen mode

Commit and push to Github

$ git add .github && \  git commit -m "maven build action"
Enter fullscreen modeExit 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

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Java Dev | Husband | Father-------
  • Location
    Seattle, WA
  • Education
    Computer Science
  • Work
    Software Developer Engineer
  • Joined

More fromCarlos Chacin ☕👽

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp