Skip to content

Commit 6595a27

Browse files
committed
Merge latest from master into v3-prototype branch
Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
2 parents 71051d6 + d837b8c commit 6595a27

42 files changed

Lines changed: 2757 additions & 683 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 0
21-
- name: Set up JDK 11
21+
- name: Set up JDK 17
2222
uses: actions/setup-java@v3
2323
with:
2424
distribution: 'temurin'
25-
java-version: 11
25+
java-version: 17
2626
- name: Cache SonarCloud packages
2727
uses: actions/cache@v3
2828
with:

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,33 @@ The methods enterCriticalSection and leaveCritialSection are available to suppor
2828
The library is available in [Maven Central org.spdx:java-spdx-library](https://search.maven.org/artifact/org.spdx/java-spdx-library).
2929

3030
If you are using Maven, you can add the following dependency in your POM file:
31-
```
31+
```xml
3232
<dependency>
3333
<groupId>org.spdx</groupId>
3434
<artifactId>java-spdx-library</artifactId>
3535
<version>(,2.0]</version>
3636
</dependency>
3737
```
3838

39-
[API JavaDocs are available here.](https://spdx.github.io/Spdx-Java-Library/)
39+
[API JavaDocs are available here](https://spdx.github.io/Spdx-Java-Library/).
4040

4141
There are a couple of static classes that help common usage scenarios:
4242

4343
- org.spdx.library.SpdxModelFactory supports the creation of specific model objects
4444
- org.spdx.library.model.license.LicenseInfoFactory supports the parsing of SPDX license expressions, creation, and comparison of SPDX licenses
4545

46+
47+
## Configuration options
48+
49+
`Spdx-Java-Library` can be configured using either Java system properties or a Java properties file located in the runtime CLASSPATH at `/resources/spdx-java-library.properties`.
50+
51+
The library has these configuration options:
52+
1. `org.spdx.useJARLicenseInfoOnly` - a boolean that controls whether the (potentially out of date) listed license information bundled inside the JAR is used (true), vs the library downloading the latest files from the SPDX website (false). Default is false (always download the latest files from the SPDX website).
53+
2. `org.spdx.downloadCacheEnabled` - a boolean that enables or disables the download cache. Defaults to `false` (the cache is disabled). The cache location is determined as per the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) (i.e. `${XDG_CACHE_HOME}/Spdx-Java-Library` or `${HOME}/.cache/Spdx-Java-Library`).
54+
3. `org.spdx.downloadCacheCheckIntervalSecs` - a long that controls how often each cache entry is rechecked for staleness, in units of seconds. Defaults to 86,400 seconds (24 hours). Set to 0 (zero) to have each cache entry checked every time (note: this will result in a lot more network I/O and negatively impact performance, albeit there is still a substantial performance saving vs not using the cache at all).
55+
56+
Note that these configuration options can only be modified prior to first use of Spdx-Java-Library. Once the library is initialized, subsequent changes will have no effect.
57+
4658
The first thing that needs to be done in your implementation is call `SpdxModelFactory.init()` - this will load all the supported versions.
4759

4860
If you are programatically creating SPDX data, you will start by creating a model store. The simplest model store is an in-memory model store which can be created with `store = new InMemSpdxStore()`. A copy manager will be needed if you are working with more than one store (e.g. a serialized format of SPDX data and in memory). If you're not sure, you should just create one. This can be done with `copyManager = new ModelCopyManager()`.

RELEASE-CHECKLIST.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Release Checklist for the SPDX Java Tools
2+
3+
- [ ] Check for any warnings from the compiler and findbugs
4+
- [ ] Run unit tests for all packages that depend on the library
5+
- [ ] Run unit tests with `export SPDX_JAVA_LIB_RUN_SLOW_TESTS=true` to ensure the extended (slow) test suite passes
6+
- [ ] Run dependency check to find any potential vulnerabilities `mvn dependency-check:check`
7+
- [ ] Test the release `mvn release:prepare -DdryRun`
8+
- [ ] Run `mvn release:prepare` - you will be prompted for the release - typically take the defaults
9+
- [ ] Run `mvn release:perform`
10+
- [ ] Release artifacts to Maven Central
11+
- [ ] Create a Git release including release notes
12+
- [ ] Zip up the files from the Maven archive and add them to the release

TestFiles/BSD-2-Clause-nl.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2015, Atlassian Pty Ltd
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
Copyright (c) <<var;name="copyright";original="<year> <owner>";match=".+">> All rights reserved.
1+
<<var;name="copyright";original="Copyright (c) <year> <owner>. ";match=".{0,5000}">>
2+
23
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
3-
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
4-
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
5-
THIS SOFTWARE IS PROVIDED BY <<var;name="copyrightHolderAsIs";original="THE COPYRIGHT HOLDERS AND CONTRIBUTORS";match=".+">> "AS IS" AND ANY <<var;name="express";original="EXPRESS";match="EXPRESS|EXPRESSED">> OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <<var;name="copyrightHolderLiability";original="THE COPYRIGHT HOLDER OR CONTRIBUTORS";match=".+">> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4+
5+
<<var;name="bullet";original="1.";match=".{0,20}">> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
<<var;name="bullet";original="2.";match=".{0,20}">> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
THIS<<beginOptional>> SOFTWARE<<endOptional>> IS PROVIDED BY <<var;name="copyrightHolderAsIs";original="THE COPYRIGHT HOLDERS AND CONTRIBUTORS";match=".+">> "AS IS" AND ANY <<var;name="express";original="EXPRESS";match="EXPRESS(ED)?">> OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <<var;name="copyrightHolderLiability";original="THE COPYRIGHT HOLDER OR CONTRIBUTORS";match=".+">> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS<<beginOptional>> SOFTWARE<<endOptional>>, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TestFiles/BSD-3-Clause-newline.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Redistribution and use in source and binary forms, with or without
2+
modification, are permitted provided that the following conditions
3+
are met:
4+
5+
- Redistributions of source code must retain the above copyright
6+
notice, this list of conditions and the following disclaimer.
7+
8+
- Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
12+
- Neither the name of the Eclipse Foundation, Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
17+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Copyright (c) <<var;name="copyright";original="<year> <owner>";match=".+">> . All rights reserved.
1+
<<var;name="copyright";original="Copyright (c) <year> <owner>. ";match=".{0,5000}">>
22

3-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
3+
Redistribution and use in source and binary forms<<var;name="theme";original="";match="()|( of the theme)">>, with or without modification, <<var;name="tobe";original="are";match="are|is">> permitted provided that the following conditions are met:
44

5-
<<var;name="bullet";original="1.";match=".{0,20}">> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
5+
<<var;name="bullet";original="1.";match=".{0,20}">> Redistributions of <<var;name="code";original="source code";match="source code|works">> must retain the <<var;name="above";original="above";match="above|original">> copyright notice, this list of conditions and the following disclaimer.
66

7-
<<var;name="bullet";original="2.";match=".{0,20}">> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7+
<<var;name="bullet";original="2.";match=".{0,20}">> Redistributions in binary form must reproduce the <<var;name="above2";original="above";match="above|original">> copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
88

9-
<<var;name="bullet";original="3.";match=".{0,20}">> Neither the name of <<var;name="organizationClause3";original="the copyright holder";match=".+">> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9+
<<var;name="bullet";original="3.";match=".{0,20}">> <<var;name="organizationClause3";original="Neither the name of the copyright holder nor the names of its contributors may";match="(The\s+name\s+of.+may\s+not)|(Neither\s+the\s+names?\s+of.+nor\s+the\s+names\s+of\s+its\s+contributors\s+may)|(\s*Neither\s+the\s+name\s+of.+nor\s+the\s+names\s+of\s+its\s+authors\s+and\s+contributors\s+may)|(Neither\s+the\s+name\s+of.+nor\s+the\s+names\s+of\s+contributors\s+may)|(Neither\s+the\s+name.+nor\s+the\s+names\s+of\s+contributors\s+may)|(The\s+names\s+of\s+its\s+contributors\s+may\s+not)|(The\s+names\s+of\s+any\s+contributors\s+may\s+not)|(The\s+names\s+of\s+the\s+contributors\s+may\s+not)|(None\s+of\s+the\s+names\s+of.+and\s+any\s+contributors\s+may)|(Neither\s+my\s+name.+nor\s+the\s+names\s+of\s+contributors\s+to\s+this\s+code\s+may)">> be used to endorse or promote products derived from this <<var;name="software";original="software";match="software|work">> without specific prior written permission.
1010

11-
THIS SOFTWARE IS PROVIDED BY <<var;name="copyrightHolderAsIs";original="THE COPYRIGHT HOLDERS AND CONTRIBUTORS";match=".+">> "AS IS" AND ANY <<var;name="express";original="EXPRESS";match="EXPRESS(ED)?">> OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <<var;name="copyrightHolderLiability";original="THE COPYRIGHT HOLDER OR CONTRIBUTORS";match=".+">> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11+
THIS <<var;name="software2";original="SOFTWARE";match="(SOFTWARE)|(THEME)">> IS PROVIDED <<var;name="copyrightHolderAsIs";original="BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS";match=".*">> "AS IS" AND ANY <<var;name="express";original="EXPRESS";match="EXPRESS(ED)?">> OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <<var;name="copyrightHolderLiability";original="THE COPYRIGHT HOLDER OR CONTRIBUTORS";match=".+">> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS <<var;name="software3";original="SOFTWARE";match="(SOFTWARE)|(THEME)">> , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)