diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..f772715ae
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,41 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Cache SonarCloud packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.sonar/cache
+ key: ${{ runner.os }}-sonar
+ restore-keys: ${{ runner.os }}-sonar
+ - name: Cache Maven packages
+ uses: actions/cache@v1
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: Build and analyze
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ run: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
deleted file mode 100644
index 74c342fe0..000000000
--- a/.github/workflows/maven.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Java CI with Maven
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- java-version: 11
- - name: Build with Maven
- run: mvn -B package --file pom.xml
diff --git a/README.md b/README.md
index f8c9a589c..f8061459c 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,10 @@
Java library which implements the Java object model for SPDX and provides useful helper functions.
+# Code quality badges
+
+| [](https://sonarcloud.io/dashboard?id=java-spdx-library) | [](https://sonarcloud.io/dashboard?id=java-spdx-library) | [](https://sonarcloud.io/dashboard?id=java-spdx-library) | [](https://sonarcloud.io/dashboard?id=java-spdx-library) |
+
## Storage Interface
The Spdx-Java-Library allows for different implementations of SPDX object storage. The storage facility implements the org.spdx.storage.IModelStore interface. This is a low level Service Provider Interface (SPI). The ISerializableModelStore extends the IModelStore and supports serializing and de-serializing the store to an I/O Stream. This interface is currently used to implement JSON, XML, YAML, and RDF/XML formats. The default storage interface is an in-memory Map which should be sufficient for light weight usage of the library.
diff --git a/pom.xml b/pom.xml
index accc0d871..a4e365ac3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.spdx
java-spdx-library
- 1.0.5-SNAPSHOT
+ 1.0.6
jar
java-spdx-library
@@ -43,6 +43,9 @@
UTF-8
+ https://sonarcloud.io
+ spdx
+ java-spdx-library
diff --git a/src/main/java/org/spdx/library/ModelCopyManager.java b/src/main/java/org/spdx/library/ModelCopyManager.java
index e514ca371..49596d69c 100644
--- a/src/main/java/org/spdx/library/ModelCopyManager.java
+++ b/src/main/java/org/spdx/library/ModelCopyManager.java
@@ -58,7 +58,7 @@ public class ModelCopyManager {
* Create a ModelCopyManager with default options
*/
public ModelCopyManager() {
-
+ // Required empty constructor
}
/**
@@ -153,48 +153,86 @@ public void copy(IModelStore toStore, String toDocumentUri, String toId, IModelS
List propertyNames = fromStore.getPropertyValueNames(fromDocumentUri, fromId);
for (String propName:propertyNames) {
if (fromStore.isCollectionProperty(fromDocumentUri, fromId, propName)) {
- Iterator