Skip to content

Commit 9f3b53a

Browse files
committed
Merge from master
2 parents cb4a8b6 + 023950f commit 9f3b53a

File tree

9 files changed

+230
-44
lines changed

9 files changed

+230
-44
lines changed

.github/workflows/ci-earthly-gradle.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
name: Gradle CI build
1+
name: Earthly/Gradle CI
22

33
env:
44
OWASP_NVD_API_KEY: ${{ secrets.OWASP_NVD_API_KEY }}
55
# Workaround for: https://github.com/earthly/earthly/issues/4220
66
EARTHLY_DISABLE_REMOTE_REGISTRY_PROXY: true
77

8+
# Ignore cross-build files with Maven
89
on:
910
push:
1011
paths-ignore:
12+
# Generic files to ignore for building
1113
- '*.md'
1214
- 'images/**'
1315
# These ignores are specific to a cross-build against Maven
1416
- 'pom.xml'
15-
- 'mvnw*'
16-
- '.mvn'
17+
- 'mvnw*' # Wraper scripts
18+
- '.mvn/**'
19+
- '.github/workflows/*maven*'
1720
# These ignores are specific to this project
1821
- 'run-with-maven.sh'
19-
- '.github/workflows/*maven*'
2022
pull_request:
2123
paths-ignore:
24+
# Generic files to ignore for building
2225
- '*.md'
2326
- 'images/**'
2427
# These ignores are specific to a cross-build against Maven
2528
- 'pom.xml'
26-
- 'mvnw*'
27-
- '.mvn'
29+
- 'mvnw*' # Wrapper scripts
30+
- '.mvn/**'
31+
- '.github/workflows/*maven*'
2832
# These ignores are specific to this project
2933
- 'run-with-maven.sh'
30-
- '.github/workflows/*maven*'
3134

3235
jobs:
3336
build:
@@ -40,7 +43,8 @@ jobs:
4043
with:
4144
# The version in CI should match the version you use locally.
4245
# This is a manual step.
43-
version: v0.8
46+
# Using "latest" to force CI warnings if Earthfile is outdated
47+
version: "latest"
4448

4549
- name: Clone repository
4650
uses: actions/checkout@v4

.github/workflows/ci-earthly-maven.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
1-
name: Maven CI build
1+
name: Earthly/Maven CI
22

33
env:
44
OWASP_NVD_API_KEY: ${{ secrets.OWASP_NVD_API_KEY }}
55
# Workaround for: https://github.com/earthly/earthly/issues/4220
66
EARTHLY_DISABLE_REMOTE_REGISTRY_PROXY: true
77

8+
# Ignore cross-build files with Gradle
89
on:
910
push:
1011
paths-ignore:
12+
# Generic files to ignore for building
1113
- '*.md'
1214
- 'images/**'
1315
# These ignores are specific to a cross-build against Gradle
1416
- 'build.gradle'
15-
- 'gradle*'
17+
- 'gradle/**' # Directory is distinct from files in GitHub ignores
18+
- 'gradle*' # Wrapper scripts and properties
1619
- '.gradle'
20+
- '.github/workflows/*gradle*'
1721
# These ignores are specific to this project
1822
- 'run-with-gradle.sh'
19-
- '.github/workflows/*gradle*'
2023
pull_request:
2124
paths-ignore:
25+
# Generic files to ignore for building
2226
- '*.md'
2327
- 'images/**'
2428
# These ignores are specific to a cross-build against Gradle
2529
- 'build.gradle'
26-
- 'gradle*'
30+
- 'gradle/**' # Directory is distinct from files in GitHub ignores
31+
- 'gradle*' # Wrapper scripts and properties
2732
- '.gradle'
33+
- '.github/workflows/*gradle*'
2834
# These ignores are specific to this project
2935
- 'run-with-gradle.sh'
30-
- '.github/workflows/*gradle*'
36+
workflow_dispatch:
3137

3238
jobs:
3339
build:
@@ -40,7 +46,8 @@ jobs:
4046
with:
4147
# The version in CI should match the version you use locally.
4248
# This is a manual step.
43-
version: v0.8
49+
# Using "latest" to force CI warnings if Earthfile is outdated
50+
version: "latest"
4451

4552
- name: Clone repository
4653
uses: actions/checkout@v4

LICENSE.md

Lines changed: 134 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,137 @@
1-
# License #
1+
The license for this code base and the accompanying wiki pages has changed to
2+
CC0 (Creative Commons Zero 1.0 Universal) from Public Domain.
3+
This is to accomodate those legal jurisdictions not supporting dedication of
4+
rights to the public until author's death.
5+
No author of these works is a lawyer: Please consult with an accredited expert
6+
in your jurisdiction for legal advice.
7+
8+
# Creative Commons Zero 1.0 Universal license
9+
10+
CC0 1.0 Universal
11+
12+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
13+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
14+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
15+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
16+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
17+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
18+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
19+
HEREUNDER.
20+
21+
Statement of Purpose
22+
23+
The laws of most jurisdictions throughout the world automatically confer
24+
exclusive Copyright and Related Rights (defined below) upon the creator
25+
and subsequent owner(s) (each and all, an "owner") of an original work of
26+
authorship and/or a database (each, a "Work").
27+
28+
Certain owners wish to permanently relinquish those rights to a Work for
29+
the purpose of contributing to a commons of creative, cultural and
30+
scientific works ("Commons") that the public can reliably and without fear
31+
of later claims of infringement build upon, modify, incorporate in other
32+
works, reuse and redistribute as freely as possible in any form whatsoever
33+
and for any purposes, including without limitation commercial purposes.
34+
These owners may contribute to the Commons to promote the ideal of a free
35+
culture and the further production of creative, cultural and scientific
36+
works, or to gain reputation or greater distribution for their Work in
37+
part through the use and efforts of others.
38+
39+
For these and/or other purposes and motivations, and without any
40+
expectation of additional consideration or compensation, the person
41+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
42+
is an owner of Copyright and Related Rights in the Work, voluntarily
43+
elects to apply CC0 to the Work and publicly distribute the Work under its
44+
terms, with knowledge of his or her Copyright and Related Rights in the
45+
Work and the meaning and intended legal effect of CC0 on those rights.
46+
47+
1. Copyright and Related Rights. A Work made available under CC0 may be
48+
protected by copyright and related or neighboring rights ("Copyright and
49+
Related Rights"). Copyright and Related Rights include, but are not
50+
limited to, the following:
51+
52+
i. the right to reproduce, adapt, distribute, perform, display,
53+
communicate, and translate a Work;
54+
ii. moral rights retained by the original author(s) and/or performer(s);
55+
iii. publicity and privacy rights pertaining to a person's image or
56+
likeness depicted in a Work;
57+
iv. rights protecting against unfair competition in regards to a Work,
58+
subject to the limitations in paragraph 4(a), below;
59+
v. rights protecting the extraction, dissemination, use and reuse of data
60+
in a Work;
61+
vi. database rights (such as those arising under Directive 96/9/EC of the
62+
European Parliament and of the Council of 11 March 1996 on the legal
63+
protection of databases, and under any national implementation
64+
thereof, including any amended or successor version of such
65+
directive); and
66+
vii. other similar, equivalent or corresponding rights throughout the
67+
world based on applicable law or treaty, and any national
68+
implementations thereof.
69+
70+
2. Waiver. To the greatest extent permitted by, but not in contravention
71+
of, applicable law, Affirmer hereby overtly, fully, permanently,
72+
irrevocably and unconditionally waives, abandons, and surrenders all of
73+
Affirmer's Copyright and Related Rights and associated claims and causes
74+
of action, whether now known or unknown (including existing as well as
75+
future claims and causes of action), in the Work (i) in all territories
76+
worldwide, (ii) for the maximum duration provided by applicable law or
77+
treaty (including future time extensions), (iii) in any current or future
78+
medium and for any number of copies, and (iv) for any purpose whatsoever,
79+
including without limitation commercial, advertising or promotional
80+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
81+
member of the public at large and to the detriment of Affirmer's heirs and
82+
successors, fully intending that such Waiver shall not be subject to
83+
revocation, rescission, cancellation, termination, or any other legal or
84+
equitable action to disrupt the quiet enjoyment of the Work by the public
85+
as contemplated by Affirmer's express Statement of Purpose.
86+
87+
3. Public License Fallback. Should any part of the Waiver for any reason
88+
be judged legally invalid or ineffective under applicable law, then the
89+
Waiver shall be preserved to the maximum extent permitted taking into
90+
account Affirmer's express Statement of Purpose. In addition, to the
91+
extent the Waiver is so judged Affirmer hereby grants to each affected
92+
person a royalty-free, non transferable, non sublicensable, non exclusive,
93+
irrevocable and unconditional license to exercise Affirmer's Copyright and
94+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
95+
maximum duration provided by applicable law or treaty (including future
96+
time extensions), (iii) in any current or future medium and for any number
97+
of copies, and (iv) for any purpose whatsoever, including without
98+
limitation commercial, advertising or promotional purposes (the
99+
"License"). The License shall be deemed effective as of the date CC0 was
100+
applied by Affirmer to the Work. Should any part of the License for any
101+
reason be judged legally invalid or ineffective under applicable law, such
102+
partial invalidity or ineffectiveness shall not invalidate the remainder
103+
of the License, and in such case Affirmer hereby affirms that he or she
104+
will not (i) exercise any of his or her remaining Copyright and Related
105+
Rights in the Work or (ii) assert any associated claims and causes of
106+
action with respect to the Work, in either case contrary to Affirmer's
107+
express Statement of Purpose.
108+
109+
4. Limitations and Disclaimers.
110+
111+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
112+
surrendered, licensed or otherwise affected by this document.
113+
b. Affirmer offers the Work as-is and makes no representations or
114+
warranties of any kind concerning the Work, express, implied,
115+
statutory or otherwise, including without limitation warranties of
116+
title, merchantability, fitness for a particular purpose, non
117+
infringement, or the absence of latent or other defects, accuracy, or
118+
the present or absence of errors, whether or not discoverable, all to
119+
the greatest extent permissible under applicable law.
120+
c. Affirmer disclaims responsibility for clearing rights of other persons
121+
that may apply to the Work or any use thereof, including without
122+
limitation any person's Copyright and Related Rights in the Work.
123+
Further, Affirmer disclaims responsibility for obtaining any necessary
124+
consents, permissions or other rights required for any use of the
125+
Work.
126+
d. Affirmer understands and acknowledges that Creative Commons is not a
127+
party to this document and has no duty or obligation with respect to
128+
this CC0 or use of the Work.
129+
130+
For more information, please refer to
131+
<https://creativecommons.org/publicdomain/zero/1.0/> and to
132+
<https://creativecommons.org/public-domain/cc0/>.
133+
134+
# Former Public Domain license
2135

3136
This is free and unencumbered software released into the public domain.
4137

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<a href="./LICENSE">
2-
<img src="./images/public-domain.svg" alt="Public Domain"
1+
<a href="./LICENSE.md">
2+
<img src="./images/cc0.svg" alt="Creative Commons 0"
33
align="right" width="10%" height="auto"/>
44
</a>
55

@@ -29,7 +29,7 @@ align="right" width="20%" height="auto"/>
2929
[![coverage](https://github.com/binkley/modern-java-practices/raw/master/images/jacoco.svg)](https://github.com/binkley/modern-java-practices/actions/workflows/ci.yml)
3030
[![pull requests](https://img.shields.io/github/issues-pr/binkley/modern-java-practices.svg)](https://github.com/binkley/modern-java-practices/pulls)
3131
[![issues](https://img.shields.io/github/issues/binkley/modern-java-practices.svg)](https://github.com/binkley/modern-java-practices/issues/)
32-
[![license](https://img.shields.io/badge/license-Public%20Domain-blue.svg)](http://unlicense.org/)
32+
[![license](https://img.shields.io/badge/License-CC0_1.0-lightgrey.svg)](http://creativecommons.org/publicdomain/zero/1.0/)
3333

3434
> [!WARNING]
3535
> For those using the DependencyCheck plugins for Gradle or Maven, over the
@@ -97,7 +97,8 @@ As a _guide_, this project focuses on:
9797
[Fork](https://github.com/binkley/modern-java-practices/fork) me,
9898
[clone](https://github.com/binkley/modern-java-practices.git) me, copy/paste
9999
freely!
100-
I am [_Public Domain_](http://unlicense.org/)
100+
I am [Creative Commons Public Domain Dedication
101+
(CC0)](https://creativecommons.org/public-domain/cc0/).
101102
* Discuss&mdash;and illustrate (through code)&mdash;sensible default practices;
102103
highlight good build tools and plugins
103104
* Document pitfalls that turned up.
@@ -117,6 +118,10 @@ As a _guide_, this project focuses on:
117118
hand: get your build to complain (_fail_) locally before sharing with your
118119
team, or fail in CI before deployment
119120

121+
These can be summed up as a _Software supply chain_: ensuring reliable,
122+
trusted software from local development through ready-to-deploy:
123+
**Build with confidence**.
124+
120125
But ... you **must** judge and measure the advice here against your own
121126
systems and processes.
122127
Some things (many or most things) may work for you:
@@ -182,10 +187,10 @@ After cloning or forking this project to your machine, try out the local build
182187
that makes sense for you:
183188

184189
```shell
185-
$ ./gradlew build # Local-only build
186190
$ earthly +build-with-gradle # CI build with Earthly
187-
$ ./mvnw verify # Local-only build
188191
$ earthly +build-with-maven # CI build with Earthly
192+
$ ./gradlew build # Local-only build
193+
$ ./mvnw verify # Local-only build
189194
```
190195

191196
Notice that you can run the build purely locally, or _in a container_?
@@ -240,7 +245,8 @@ align="right" width="20%" height="auto"/>
240245
(For detailed changes in the example code, browse the [commit
241246
log](https://github.com/binkley/modern-java-practices/commits/master/).)
242247

243-
- Gradle: Bump to Gradle 8.8.
248+
- Move to a CC0 license from Public Domain.
249+
- Gradle: Bump to Gradle 8.9.
244250
- Migrate most of the `README.md` to the [GitHub project
245251
wiki](https://github.com/binkley/modern-java-practices/wiki).
246252
This is breaks up an overlong (14k+ words and growing) README into

build.gradle

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@ import com.github.spotbugs.snom.Confidence
33
import com.github.spotbugs.snom.Effort
44

55
plugins {
6+
// TODO: Since Gradle is not static description but live code, does the
7+
// ordering of plugins have impact?
8+
id "java" // Gradle support for Java
9+
// TODO: #607. How to leverage the Gradle dashboard?
610
id "build-dashboard" // See build/reports/buildDashboard/index.html
7-
// TODO: project-report is presently broken because of pitest task
11+
// TODO: Leverage the projectReport task for showing in CI
812
id "project-report" // Try the `projectReport` task
9-
alias libs.plugins.com.dorongold.task.tree
10-
alias libs.plugins.com.github.ben.manes.versions
11-
alias libs.plugins.nl.littlerobots.version.catalog.update
12-
id "java" // Gradle support for Java
13+
alias libs.plugins.com.dorongold.task.tree.plugin
14+
alias libs.plugins.com.github.ben.manes.versions.plugin
15+
alias libs.plugins.nl.littlerobots.version.catalog.update.plugin
1316
id "checkstyle" // To check that code follow style standards
17+
id "jacoco" // To run test coverage
1418
id "pmd" // Static analysis based on source (does not check compiled code)
1519
id "com.github.spotbugs" // Static analysis based on compiled code (does not check source)
20+
alias libs.plugins.com.diffplug.spotless.plugin
1621
alias libs.plugins.com.github.andygoossens.gradle.modernizer.plugin
17-
id "jacoco" // To run test coverage
1822
id "info.solidsoft.pitest" // To run mutation testing
19-
alias libs.plugins.org.kordamp.gradle.jdeps
20-
alias libs.plugins.org.owasp.dependencycheck
23+
alias libs.plugins.org.kordamp.gradle.jdeps.plugin
24+
alias libs.plugins.org.owasp.dependencycheck.plugin
2125
id "application" // To build the executable jar
22-
id("com.diffplug.spotless") version "7.0.0.BETA1"
2326
}
2427

2528
version = "0-SNAPSHOT"

gradle/libs.versions.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
[versions]
2+
com-diffplug-spotless-plugin = "7.0.0.BETA1"
3+
com-dorongold-task-tree-plugin = "4.0.0"
4+
com-github-andygoossens-gradle-modernizer-plugin = "1.9.3"
25
com-github-ben-manes-versions-plugin = "0.51.0"
36
com-github-spotbugs = "4.8.6"
47
com-google-code-findbugs = "3.0.1"
@@ -8,15 +11,13 @@ nl-littlerobots-version-catalog-update-plugin = "0.8.4"
811
org-assertj = "3.26.3"
912
org-gaul-modernizer = "2.9.0"
1013
org-jacoco = "0.8.12"
11-
org-junit-jupiter = "5.11.0-RC1"
14+
org-junit-jupiter = "5.11.0"
1215
org-kordamp-gradle-jdeps-plugin = "0.20.0"
1316
org-mockito = "5.12.0"
1417
org-owasp-dependencycheck-plugin = "10.0.3"
1518
org-pitest-pitest-command-line = "1.16.1"
1619
org-pitest-pitest-junit5-plugin = "1.2.1"
1720
org-projectlombok = "1.18.34"
18-
com-dorongold-task-tree-plugin = "4.0.0"
19-
com-github-andygoossens-gradle-modernizer-plugin = "1.9.3"
2021

2122
[libraries]
2223
com-github-spotbugs-spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version.ref = "com-github-spotbugs" }
@@ -36,9 +37,10 @@ org-pitest-pitest-junit5-plugin = { module = "org.pitest:pitest-junit5-plugin",
3637
org-projectlombok-lombok = { module = "org.projectlombok:lombok", version.ref = "org-projectlombok" }
3738

3839
[plugins]
39-
com-dorongold-task-tree = { id = "com.dorongold.task-tree", version.ref = "com-dorongold-task-tree-plugin" }
40+
com-diffplug-spotless-plugin = { id = "com.diffplug.spotless", version.ref = "com-diffplug-spotless-plugin" }
41+
com-dorongold-task-tree-plugin = { id = "com.dorongold.task-tree", version.ref = "com-dorongold-task-tree-plugin" }
4042
com-github-andygoossens-gradle-modernizer-plugin = { id = "com.github.andygoossens.gradle-modernizer-plugin", version.ref = "com-github-andygoossens-gradle-modernizer-plugin" }
41-
com-github-ben-manes-versions = { id = "com.github.ben-manes.versions", version.ref = "com-github-ben-manes-versions-plugin" }
42-
org-kordamp-gradle-jdeps = { id = "org.kordamp.gradle.jdeps", version.ref = "org-kordamp-gradle-jdeps-plugin" }
43-
org-owasp-dependencycheck = { id = "org.owasp.dependencycheck", version.ref = "org-owasp-dependencycheck-plugin" }
44-
nl-littlerobots-version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "nl-littlerobots-version-catalog-update-plugin" }
43+
com-github-ben-manes-versions-plugin = { id = "com.github.ben-manes.versions", version.ref = "com-github-ben-manes-versions-plugin" }
44+
nl-littlerobots-version-catalog-update-plugin = { id = "nl.littlerobots.version-catalog-update", version.ref = "nl-littlerobots-version-catalog-update-plugin" }
45+
org-kordamp-gradle-jdeps-plugin = { id = "org.kordamp.gradle.jdeps", version.ref = "org-kordamp-gradle-jdeps-plugin" }
46+
org-owasp-dependencycheck-plugin = { id = "org.owasp.dependencycheck", version.ref = "org-owasp-dependencycheck-plugin" }

images/Wikibooks-contribute-icon.svg

100755100644
File mode changed.

0 commit comments

Comments
 (0)