Application Spring Boot packagée en WAR, compatible Tomcat / Jetty, avec linter, tests, build Maven.
Check outdated dependencies and plugins:
mvn versions:display-dependency-updates
mvn versions:display-plugin-updatesAnalyse du style de code Java avec Checkstyle :
mvn checkstyle:check⛔️ La build échoue si le code ne respecte pas les règles définies dans checkstyle.xml.
Exécution des tests + génération du rapport JaCoCo :
mvn clean test
mvn jacoco:reportRapport de couverture généré dans :
target/site/jacoco/index.html
Compilation + tests + packaging + installation locale :
mvn clean installGénère le fichier :
target/backend-springboot-1.0.0.war
- Copier le fichier WAR dans :
<chemin-vers-tomcat>/webapps
-
Démarrer Tomcat
-
Accéder à l'application :
- http://localhost:8080/backend-springboot-1.0.0/
- http://localhost:8080/backend-springboot-1.0.0/persons
Ajoute dans pom.xml :
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>11.0.25</version>
<configuration>
<webApp>
<contextPath>/</contextPath>
</webApp>
</configuration>
</plugin>Puis exécute :
mvn clean compile jetty:run
# ou simplement :
mvn jetty:runAccès local :
mvn clean
mvn compile
mvn test
mvn package
mvn install
mvn checkstyle:check
mvn dependency:treejava -jar target/backend-springboot-1.0.0.jar