Giter Site home page Giter Site logo

mygithubactionstest's Introduction

MyGitHubActionsTest

Repository that demonstrates GitHubActions mit Java Maven

Vorausetzungen Software

Git bzw. TortoiseGit Maven VS Code

Java Maven

Es gibt in GitHub fertige Workflows für Ant, Grant, Maven.

Ant ist alt und konnte ich nicht auf meinem Rechner installieren, Stand 8/23. Nach Rücksprache haben wir uns für Maven entschieden. Ich wusste von Maven nur das es eine Build Tool ist. Das folgende Video erklärt die Kette die Maven abarbeitet:

https://www.youtube.com/watch?v=ExKq23bNABk

Dreh und Angelpunkt von Maven ist die pom.xml (Project Object Model), dort wird definiert was maven tun soll. Maven führt folgende Schritte durch:

  • validate (optional)
  • compile (kompiliert in alle möglichen Formate, ist im POM File definiert)
  • test
  • package (.war oder .jars erstellen)
  • verify
  • install (lokal in ein Verzeichniss kopieren)
  • deploy (ins Maverepository kopieren und verfügbar machen, nicht auf den Anwendungsserver)

Maven Projekt erstellen:

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

Java Klasse und JUnit im richtigen Verzeichniss ablegen

C:\Users\xxxxx\Desktop\MavenTest\MyGitHubActionsTest\my-app\src\test\java\com\mycompany\app -> JUnit Test C:\Users\xxxxx\Desktop\MavenTest\MyGitHubActionsTest\my-app\src\main\java\com\mycompany\app -> Java Klasse

Java compilieren

mvn compile

schlägt fehl weil ich JRE installiert habe, da aber in Github compiliert werden soll, kann das ausgelassen werden.

git push

git add .
git commit -m "Initial commit"
git push -u origin master

pom.xml muss auf Ebene von .git

ich habe das Projet falsch erstellt, die pom.xml liegt im falschen Verzeichniss

Java Klasse vs. Swing Project

Dieses Beispiel enthält einen Taschenrechner und JUnittest erstellt von ChatGPT. Im nächsten Schritt soll dieses Projket wiederholt werden nur mit einer SPRING Applikation.

mygithubactionstest's People

Contributors

opino avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.