-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (54 loc) · 1.64 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
artifact_name := filing-history-data-api
version := unversioned
.PHONY: clean
clean:
mvn clean
rm -f ./$(artifact_name).jar
rm -f ./$(artifact_name)-*.zip
rm -rf ./build-*
rm -rf ./build.log-*
.PHONY: test
test: test-integration test-unit
.PHONY: test-unit
test-unit: clean
mvn verify -Dskip.unit.tests=false -Dskip.integration.tests=false
.PHONY: test-integration
test-integration: clean
mvn verify -Dskip.unit.tests=true -Dskip.integration.tests=false
.PHONY: coverage
coverage:
mvn verify
.PHONY: verify
verify: test-unit test-integration
.PHONY: package
package:
ifndef version
$(error No version given. Aborting)
endif
mvn versions:set -DnewVersion=$(version) -DgenerateBackupPoms=false
$(info Packaging version: $(version))
@test -s ./$(artifact_name).jar || { echo "ERROR: Service JAR not found"; exit 1; }
$(eval tmpdir:=$(shell mktemp -d build-XXXXXXXXXX))
cp ./start.sh $(tmpdir)
cp ./$(artifact_name).jar $(tmpdir)/$(artifact_name).jar
cd $(tmpdir); zip -r ../$(artifact_name)-$(version).zip *
rm -rf $(tmpdir)
.PHONY: build
build:
mvn versions:set -DnewVersion=$(version) -DgenerateBackupPoms=false
mvn package -Dmaven.test.skip=true
cp ./target/$(artifact_name)-$(version).jar ./$(artifact_name).jar
.PHONY: build-container
build-container: build
docker build .
.PHONY: dist
dist: clean build package coverage
.PHONY: sonar
sonar:
mvn sonar:sonar
.PHONY: sonar-pr-analysis
sonar-pr-analysis:
mvn sonar:sonar -P sonar-pr-analysis # will report some false code smells until java 21 is supported
.PHONY: security-check
security-check:
mvn org.owasp:dependency-check-maven:check -DassemblyAnalyzerEnabled=false