[DEV] integrate maven build
This commit is contained in:
parent
672e37844e
commit
ff822ada9a
@ -1,38 +1,52 @@
|
|||||||
image: heeroyui/scenarium-gitlabci:latest
|
image: heeroyui/scenarium-gitlabci:latest
|
||||||
|
|
||||||
before_script:
|
variables:
|
||||||
- ls ~/javaFXSDK/javafx-sdk-14/lib
|
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
|
||||||
- ls ~
|
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
|
||||||
|
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF8"
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .m2/repository/
|
||||||
|
- target/
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- style
|
- style
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- package
|
||||||
|
|
||||||
style_job:
|
style_job:
|
||||||
stage: style
|
stage: style
|
||||||
script:
|
script:
|
||||||
- export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
- java -jar ~/checkstyle.jar -c CheckStyle.xml `find src/ -name "*.java"`
|
||||||
- java -jar checkstyle.jar -c CheckStyle.xml `find src/ -name "*.java"`
|
- java -jar ~/checkstyle.jar -c CheckStyle.xml `find test/src/ -name "*.java"`
|
||||||
- java -jar checkstyle.jar -c CheckStyle.xml `find test/src/ -name "*.java"`
|
|
||||||
|
|
||||||
build_job:
|
build_job:
|
||||||
stage: build
|
stage: build
|
||||||
dependencies:
|
dependencies:
|
||||||
- style_job
|
- style_job
|
||||||
script:
|
script:
|
||||||
- export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
- mvn $MAVEN_CLI_OPTS compile
|
||||||
- eval echo "~$USER"
|
|
||||||
- ant clean
|
|
||||||
- ant build
|
|
||||||
|
|
||||||
test_job:
|
test_job:
|
||||||
stage: test
|
stage: test
|
||||||
dependencies:
|
dependencies:
|
||||||
- build_job
|
- build_job
|
||||||
script:
|
script:
|
||||||
- export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
- mvn $MAVEN_CLI_OPTS test
|
||||||
- ant clean build TestBasicLog
|
|
||||||
artifacts:
|
artifacts:
|
||||||
reports:
|
reports:
|
||||||
junit: junit/TEST-*.xml
|
junit: junit/TEST-*.xml
|
||||||
|
|
||||||
|
package_job:
|
||||||
|
stage: package
|
||||||
|
dependencies:
|
||||||
|
- test_job
|
||||||
|
script:
|
||||||
|
- mvn $MAVEN_CLI_OPTS package
|
||||||
|
artifacts:
|
||||||
|
when: on_success
|
||||||
|
expire_in: 1 day
|
||||||
|
paths:
|
||||||
|
- target/*.jar
|
72
pom.xml
Normal file
72
pom.xml
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>scenarium-logger</groupId>
|
||||||
|
<artifactId>scenarium-logger</artifactId>
|
||||||
|
<version>0.1.0</version>
|
||||||
|
<description>Scenarium generic logger</description>
|
||||||
|
<dependencies>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<version>5.6.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
<testSourceDirectory>test/src</testSourceDirectory>
|
||||||
|
<testResources>
|
||||||
|
<testResource>
|
||||||
|
<directory>test/src</directory>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/*.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
|
<plugins>
|
||||||
|
<!-- Build the application or the library or the plug-in -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<release>14</release>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<!-- Create the source bundle -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- Create coverage -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
|
<version>0.8.5</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>prepare-agent</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<!-- attached to Maven test phase -->
|
||||||
|
<execution>
|
||||||
|
<id>report</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>report</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
Binary file not shown.
@ -8,7 +8,7 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package test.scenarium.logger;
|
package test.scenarium.logger;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class TestBasicLog {
|
public class TestBasicLog {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user