Skip to content

Commit e6e44c5

Browse files
article: Static analysis of Java application dependencies
0 parents  commit e6e44c5

28 files changed

+857
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '34 23 * * 6'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'java' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
#- run: |
63+
# make bootstrap
64+
# make release
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v1

.gitignore

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/maven,java,visualstudiocode,git,eclipse
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=maven,java,visualstudiocode,git,eclipse
4+
5+
### Eclipse ###
6+
.metadata
7+
bin/
8+
tmp/
9+
*.tmp
10+
*.bak
11+
*.swp
12+
*~.nib
13+
local.properties
14+
.settings/
15+
.loadpath
16+
.recommenders
17+
18+
# External tool builders
19+
.externalToolBuilders/
20+
21+
# Locally stored "Eclipse launch configurations"
22+
*.launch
23+
24+
# PyDev specific (Python IDE for Eclipse)
25+
*.pydevproject
26+
27+
# CDT-specific (C/C++ Development Tooling)
28+
.cproject
29+
30+
# CDT- autotools
31+
.autotools
32+
33+
# Java annotation processor (APT)
34+
.factorypath
35+
36+
# PDT-specific (PHP Development Tools)
37+
.buildpath
38+
39+
# sbteclipse plugin
40+
.target
41+
42+
# Tern plugin
43+
.tern-project
44+
45+
# TeXlipse plugin
46+
.texlipse
47+
48+
# STS (Spring Tool Suite)
49+
.springBeans
50+
51+
# Code Recommenders
52+
.recommenders/
53+
54+
# Annotation Processing
55+
.apt_generated/
56+
.apt_generated_test/
57+
58+
# Scala IDE specific (Scala & Java development for Eclipse)
59+
.cache-main
60+
.scala_dependencies
61+
.worksheet
62+
63+
# Uncomment this line if you wish to ignore the project description file.
64+
# Typically, this file would be tracked if it contains build/dependency configurations:
65+
#.project
66+
67+
### Eclipse Patch ###
68+
# Spring Boot Tooling
69+
.sts4-cache/
70+
71+
### Git ###
72+
# Created by git for backups. To disable backups in Git:
73+
# $ git config --global mergetool.keepBackup false
74+
*.orig
75+
76+
# Created by git when using merge tools for conflicts
77+
*.BACKUP.*
78+
*.BASE.*
79+
*.LOCAL.*
80+
*.REMOTE.*
81+
*_BACKUP_*.txt
82+
*_BASE_*.txt
83+
*_LOCAL_*.txt
84+
*_REMOTE_*.txt
85+
86+
### Java ###
87+
# Compiled class file
88+
*.class
89+
90+
# Log file
91+
*.log
92+
93+
# BlueJ files
94+
*.ctxt
95+
96+
# Mobile Tools for Java (J2ME)
97+
.mtj.tmp/
98+
99+
# Package Files #
100+
*.jar
101+
*.war
102+
*.nar
103+
*.ear
104+
*.zip
105+
*.tar.gz
106+
*.rar
107+
108+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
109+
hs_err_pid*
110+
111+
### Maven ###
112+
target/
113+
pom.xml.tag
114+
pom.xml.releaseBackup
115+
pom.xml.versionsBackup
116+
pom.xml.next
117+
release.properties
118+
dependency-reduced-pom.xml
119+
buildNumber.properties
120+
.mvn/timing.properties
121+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
122+
.mvn/wrapper/maven-wrapper.jar
123+
.flattened-pom.xml
124+
125+
### VisualStudioCode ###
126+
.vscode/*
127+
!.vscode/tasks.json
128+
!.vscode/launch.json
129+
*.code-workspace
130+
131+
### VisualStudioCode Patch ###
132+
# Ignore all local history of files
133+
.history
134+
.ionide
135+
136+
# End of https://www.toptal.com/developers/gitignore/api/maven,java,visualstudiocode,git,eclipse
137+
138+
.mvn/
139+
mvnw
140+
mvnw.cmd

.gitlab-ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
stages:
2+
- build
3+
4+
maven:
5+
stage: build
6+
image:
7+
name: maven:3.6-openjdk-8
8+
variables:
9+
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
10+
script:
11+
- mvn clean install -DskipTests
12+
cache:
13+
key: ${CI_JOB_NAME}
14+
paths:
15+
- .m2/repository
16+
artifacts:
17+
paths:
18+
- target/dependency-check-report.html
19+
expire_in: 30 min

Jenkinsfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pipeline {
2+
agent {
3+
docker {
4+
image 'maven:3.6-openjdk-8'
5+
}
6+
}
7+
8+
triggers {
9+
pollSCM('*/1 * * * *')
10+
}
11+
12+
stages {
13+
stage ('Maven build') {
14+
steps {
15+
sh 'mvn clean install -DskipTests'
16+
dependencyCheckPublisher pattern: 'target/dependency-check-report.xml'
17+
}
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)