This repository was archived by the owner on Jul 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +185
-651
lines changed
main/java/org/fugerit/java/yaml/doc/maven
java/test/org/fugerit/java/yaml/doc/maven Expand file tree Collapse file tree 9 files changed +185
-651
lines changed Original file line number Diff line number Diff line change 1+ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+ # This workflow uses actions that are not certified by GitHub.
5+ # They are provided by a third-party and are governed by
6+ # separate terms of service, privacy policy, and support
7+ # documentation.
8+
9+ name : CI build maven package
10+
11+ on :
12+ push :
13+ branches :
14+ - main
15+ - develop
16+ - branch-sonarcloud
17+ pull_request :
18+ branches :
19+ - main
20+
21+ jobs :
22+ build :
23+
24+ runs-on : ubuntu-latest
25+
26+ steps :
27+ - uses : actions/checkout@v3
28+ - name : Set up JDK 11
29+ uses : actions/setup-java@v3
30+ with :
31+ java-version : ' 11'
32+ distribution : ' corretto'
33+ cache : maven
34+ - name : Build with Maven
35+ run : mvn -P full,coverage,metadata -B package --file pom.xml
36+
37+ # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
38+ - name : Update dependency graph
39+ uses :
advanced-security/[email protected]
Original file line number Diff line number Diff line change 1+ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+ # This workflow uses actions that are not certified by GitHub.
5+ # They are provided by a third-party and are governed by
6+ # separate terms of service, privacy policy, and support
7+ # documentation.
8+
9+ name : CI deploy maven package
10+
11+ on :
12+ push :
13+ branches :
14+ - deploy
15+
16+ jobs :
17+ build :
18+
19+ runs-on : ubuntu-latest
20+
21+ steps :
22+ - uses : actions/checkout@v3
23+ - name : Set up JDK 11
24+ uses : actions/setup-java@v3
25+ with :
26+ java-version : ' 11'
27+ distribution : ' corretto'
28+ cache : maven
29+ - name : Release Maven package
30+ uses : samuelmeuli/action-maven-publish@v1
31+ with :
32+ gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
33+ gpg_passphrase : ${{ secrets.PASSPHRASE }}
34+ nexus_username : ${{ secrets.OSS_USERNAME }}
35+ nexus_password : ${{ secrets.OSS_PASSWORD }}
36+ maven_args : -P doRelease
Original file line number Diff line number Diff line change 4747 # SonarCloud access token should be generated from https://sonarcloud.io/account/security/
4848 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
4949 - name : Build and analyze
50- run : mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage
50+ run : mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage -Pcoverage,sonarfugerit -Dsonar.projectKey=fugerit-org_${{github.event.repository.name}}
5151 env :
5252 # Needed to get some information about the pull request, if any
5353 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ # Changelog
2+
3+ All notable changes to this project will be documented in this file.
4+
5+ The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
6+ and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7+
8+ ## [ Unreleased]
9+
10+ ## [ 0.5.0] - 2023-09-21
11+
12+ ### Added
13+
14+ - [ workflow deploy on branch deploy] ( .github/workflows/deploy_maven_package.yml )
15+ - [ workflow maven build] ( .github/workflows/build_maven_package.yml )
16+ - keep a changelog and coverage badge
17+
18+ ### Changed
19+
20+ - [ workflow sonar cloud] ( .github/workflows/sonarcloud-maven.yml )
21+ - fj-bom version set to 1.4.0
22+ - yaml-doc-tool version to 0.5.0
23+
1240.4.2 (2023-08-29)
225------------------
326* Changed yaml-doc-tool version to 0.4.2
Original file line number Diff line number Diff line change 22
33Simple maven plugin for [ yaml-doc-tool] ( https://github.com/fugerit-org/yaml-doc-tool ) project.
44
5+ [ ![ Keep a Changelog v1.1.0 badge] ( https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.1.0-%23E05735 )] ( CHANGELOG.md )
56[ ![ Maven Central] ( https://img.shields.io/maven-central/v/org.fugerit.java/yaml-doc-maven-plugin.svg )] ( https://mvnrepository.com/artifact/org.fugerit.java/yaml-doc-maven-plugin )
67[ ![ license] ( https://img.shields.io/badge/License-Apache%20License%202.0-teal.svg )] ( https://opensource.org/licenses/Apache-2.0 )
78[ ![ Quality Gate Status] ( https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_yaml-doc-maven-plugin&metric=alert_status )] ( https://sonarcloud.io/summary/new_code?id=fugerit-org_yaml-doc-maven-plugin )
9+ [ ![ Coverage] ( https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_yaml-doc-maven-plugin&metric=coverage )] ( https://sonarcloud.io/summary/new_code?id=fugerit-org_yaml-doc-maven-plugin )
810
911Accepted config params are :
1012* configPath
Original file line number Diff line number Diff line change 77 <parent >
88 <groupId >org.fugerit.java</groupId >
99 <artifactId >fj-bom</artifactId >
10- <version >1.2.5 </version >
10+ <version >1.4.0 </version >
1111 <relativePath ></relativePath >
1212 </parent >
1313
14- <version >0.4.2 </version >
14+ <version >0.5.0 </version >
1515 <packaging >maven-plugin</packaging >
1616
1717 <name >yaml-doc-maven-plugin</name >
2828 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
2929 <maven .compiler.target>1.8</maven .compiler.target>
3030 <maven .compiler.source>1.8</maven .compiler.source>
31- <yaml-doc-version >${project.version} </yaml-doc-version >
31+ <yaml-doc-version >0.5.0 </yaml-doc-version >
3232 <!-- sonar cloud configuration -->
3333 <sonar .host.url>https://sonarcloud.io</sonar .host.url>
3434 <sonar .organization>fugerit-org</sonar .organization>
Original file line number Diff line number Diff line change 88import org .apache .maven .plugins .annotations .Parameter ;
99import org .fugerit .java .yaml .doc .YamlDocMain ;
1010
11+ import lombok .Setter ;
12+
1113@ Mojo ( name = "generate" )
1214public class MojoGenerate extends AbstractMojo {
1315
1416 @ Parameter (property = "configPath" , required = true )
15- private String configPath ;
17+ @ Setter private String configPath ;
1618
1719 @ Parameter (property = "idCatalog" , required = true )
18- private String idCatalog ;
20+ @ Setter private String idCatalog ;
1921
2022 public void execute () throws MojoExecutionException {
2123 try {
Original file line number Diff line number Diff line change 11package test .org .fugerit .java .yaml .doc .maven ;
22
3+ import java .io .File ;
4+
35import org .apache .maven .plugin .MojoExecutionException ;
6+ import org .fugerit .java .core .function .SafeFunction ;
47import org .fugerit .java .yaml .doc .maven .MojoGenerate ;
58import org .junit .Assert ;
69import org .junit .Test ;
@@ -12,15 +15,21 @@ public class TestMojoGenerate {
1215
1316 @ Test
1417 public void testMojoeGenerate001 () {
15- MojoGenerate generate = new MojoGenerate ();
16- boolean ok = false ;
17- try {
18+ SafeFunction .apply ( () -> {
19+ MojoGenerate generate = new MojoGenerate ();
20+ generate .setConfigPath ( "src/test/resources/yaml-doc-config.xml" );
21+ generate .setIdCatalog ( "sample" );
1822 generate .execute ();
19- } catch (MojoExecutionException e ) {
20- log .info ( "mojo generate exception ok : {}" , e .getMessage () );
21- ok = true ;
22- Assert .assertTrue (ok );
23- }
23+ File pdf = new File ( "target/sample.pdf" );
24+ log .info ( "output {}" , pdf );
25+ Assert .assertTrue ( pdf .exists () );
26+ } );
27+ }
28+
29+ @ Test
30+ public void testMojoeGenerate001Fail () {
31+ MojoGenerate generate = new MojoGenerate ();
32+ Assert .assertThrows ( MojoExecutionException .class , () -> generate .execute () );
2433 }
2534
2635}
You can’t perform that action at this time.
0 commit comments