diff --git a/.gitignore b/.gitignore index a345ae0..2b6042d 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,9 @@ build/ # testing /coverage +# wrapper +/node + # production /build diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..0b77208 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16.14.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d0e68f5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +jobs: + include: + - language: node_js + - language: java + cache: + directories: + - "$HOME/.m2" + before_install: + # "node" is an alias for the latest version + - nvm install node + script: + # the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis + - mvn clean verify sonar:sonar -Pcoverage -DskipRedundantTests -Dsonar.projectKey=silentsoft_hits -Dsonar.sources=src/main/java,src/main/react + +git: + depth: false + +addons: + sonarcloud: + organization: "silentsoft" + token: + secure: "O9I2+3DaVmoEuRblOn+Wv2EQSWlzCoujmBxBYmBlAudvmFXIPocPcHJXJT2hnLdKJDhVBv922JRuawwLSqVnGnNZuN9NWqDZbN79lEOXA6789V3Dd2M6LZhbEzRzNcCh2oqv8T8estta6Cf7po7CNkplZ1lbCxnKmzyv6Vuw8pqSf5UgYfZoMg+noL44qigt2d5RB3eZK9zkvNCbG8y+oHg9jmEsXJ+RVUEzHhKQwly5rlGiTqBf7yqD79hgSCmFDy7hUWpf/s8zLJQm0TdeiMn0lC82nWG0tjGwUMPbK98dhxEzFJL6NJTo4BkuDDHGAkshexwA0I7kTaWIsbHdgeFqKLy1fCz9QeL1fotzq4Cbcn1WyuvmWzBflRiNaHuKuh21Exk6iHCbe742eQu7BLpzoyhdUyUkIlaUTaJQ3AbX1oCsKCzdb5z0p9a6sMjNpSVuthXeQnc5cE+8MJnxE/kv6Bx/+ptDSWkoFkHZm+RPVLp7eNlct3NfXNcDyXAvKfRCwo+8uLi0BskKQE3Qb0rnxG1usJiAmMBc83z30A6gKPmEF6kvowl6Ej269bCL/MI1PcPiTsVEdW147oPtKzkyccYa+UKhPbER/1iJaFpTUQeyBHWK9A+yjo7V7Bsw2oyHzqukhKPoA1A504nWmuquyTJ0MvjFGbbMfYop1hE=" + +notifications: + slack: + secure: "wnKJB3Yaxaw77Ls5WiDSNzrHbNmUhdgiigCiFk121UncDfX1zBhlUAze05v7FllnY4/iHTeJoXRCDUMHfj7KPjLXutaoqa0YidpVQxWtxPJMbajBesSTjuOwjjrl5LDCWriNnRhUfcSDZwoDJSVH6ArhaXcftUX0yyHHqnr2TNc60+hfSScJNolmmgy9ht14D/7Pi2p92CmbNEVf1+sDxRnjtanV0Sk9neMTDcNuLvJYxnf+Y7mJtSgjkQsz/3UgLYDbEWmpVynONuSOu05sAG0zWTLZIXJPGL7+W2mW3VSP85wF8APVvLDB9lafY129Q1XnTUaFdu6F3ZMu9L7+CIbXhDspoikjonkhthCJDm6KtJ4+KBxLN03GDwqXy/rVpk6ER6i9jOp5bwrt7BHCbin5zYpsoMWZdpj1TyeI8zRDJdLm0GIxRxx08jAxHJSphnt+dzR7qMIymD9nv12rYVCejcosGooLWRBD+EtNSwdD/8Ne3MnfhN8m9cuiZHtcNKPjcS1Uk6m0GWU4pL4ZP0An+0cbfcnoMWZiG3Ic3iA9Ho9bSCfm1c1uNV/lwJfV4/hfx/8tiAjzoijTFTN8oIBXqsMnnDsPax1OXDGZvKCM8mWHtSmPLcIJMErY6fwEJgMnlr752RPA2ZQHR+tvT3eZa0PZonOqDPl30bt21Is=" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2c7fd13..13f293e 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,36 @@ ${project.artifactId} + + coverage + + dev + build:dev + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + prepare-agent + + prepare-agent + + + + report + + report + + + + + + + @@ -77,40 +107,62 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.2 + org.springframework.boot spring-boot-maven-plugin - org.codehaus.mojo - exec-maven-plugin - 1.6.0 + com.github.eirslett + frontend-maven-plugin + 1.9.1 + + v16.14.0 + + + install-node-and-npm + + install-node-and-npm + + generate-resources + npm-install - initialize - exec + npm + generate-resources - npm - - install - + install npm-run-build - process-resources - exec + npm + generate-resources - npm - - run - ${npmBuildScript} - + run ${npmBuildScript} diff --git a/src/test/java/org/silentsoft/oss/NoticeFileTest.java b/src/test/java/org/silentsoft/oss/NoticeFileTest.java index 7db6b41..46e127a 100644 --- a/src/test/java/org/silentsoft/oss/NoticeFileTest.java +++ b/src/test/java/org/silentsoft/oss/NoticeFileTest.java @@ -3,8 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; import java.io.*; import java.nio.file.Paths; @@ -16,7 +15,7 @@ public class NoticeFileTest { @Test - @DisabledOnOs(OS.WINDOWS) + @DisabledIfSystemProperty(named = "skipRedundantTests", matches = "true") public void noticeFileTest() throws Exception { NoticeFileGenerator.NoticeFileBuilder noticeBuilder = NoticeFileGenerator.newInstance("Hits", "silentsoft.org"); @@ -24,9 +23,6 @@ public void noticeFileTest() throws Exception { addBackendLibraries(noticeBuilder); String markdown = noticeBuilder.generate(); - System.out.println("--------START OF THE NOTICE FILE--------"); - System.out.println(markdown); - System.out.println("---------END OF THE NOTICE FILE---------"); StringBuilder stringBuilder = new StringBuilder(); try (FileReader fileReader = new FileReader(Paths.get(System.getProperty("user.dir"), "NOTICE.md").toFile());