diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d967dbe..9c4d73d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -31,7 +31,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build Site for Maven Plugin if: github.ref != 'refs/heads/master' - run: mvn -B clean site --file aem-classification-maven-plugin/pom.xml + run: ./mvnw -B clean site --file aem-classification-maven-plugin/pom.xml - name: Build, Analyse and Deploy Reactor with Maven if: github.ref == 'refs/heads/master' run: ./mvnw -B clean deploy org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Netcentric_aem-classification -Dsonar.organization=netcentric -Dsonar.host.url=https://sonarcloud.io -Pcoverage-report diff --git a/aem-classification-validator/pom.xml b/aem-classification-validator/pom.xml index d855741..8edca2b 100644 --- a/aem-classification-validator/pom.xml +++ b/aem-classification-validator/pom.xml @@ -38,17 +38,12 @@ org.apache.commons commons-csv - 1.6 - - - commons-lang - commons-lang - 2.5 + 1.12.0 commons-io commons-io - 2.7 + 2.17.0 org.slf4j diff --git a/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/ContentClassificationMapImpl.java b/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/ContentClassificationMapImpl.java index 192ea25..9a65522 100644 --- a/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/ContentClassificationMapImpl.java +++ b/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/ContentClassificationMapImpl.java @@ -28,7 +28,6 @@ import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVRecord; -import org.apache.commons.lang.StringUtils; import org.apache.jackrabbit.util.Text; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -59,7 +58,7 @@ public class ContentClassificationMapImpl implements ContentClassificationMap { protected final Map remarkMap; // key = absolute repository path private String label; - private static final CSVFormat CSV_FORMAT = CSVFormat.RFC4180.withCommentMarker('#'); + static final CSVFormat CSV_FORMAT = CSVFormat.Builder.create(CSVFormat.RFC4180).setCommentMarker('#').build(); private static final Logger LOGGER = LoggerFactory.getLogger(ContentClassificationMapImpl.class); public ContentClassificationMapImpl(String label) { @@ -101,7 +100,7 @@ protected void put(@NotNull String resourcePath, @NotNull ContentClassification throw new IllegalArgumentException("Only absolute resource paths are supported, but resource path given is '" + resourcePath + "'."); } classificationMap.put(resourcePath, classification); - if (StringUtils.isNotEmpty(remark)) { + if (remark != null && !remark.isEmpty()) { remarkMap.put(resourcePath, remark); } } @@ -110,7 +109,7 @@ protected void put(@NotNull String resourcePath, @NotNull ContentClassification @NotNull public Entry getContentClassificationAndRemarkForResourcePath(@NotNull String resourcePath, @Nullable Collection whitelistedResourcePaths) { // ignore empty resourceTypes - if (StringUtils.isBlank(resourcePath)) { + if (resourcePath == null || resourcePath.isEmpty()) { return new SimpleEntry<>(ContentClassification.PUBLIC, null); } diff --git a/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/MutableContentClassificationMapImpl.java b/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/MutableContentClassificationMapImpl.java index 7fe0974..8f735ff 100644 --- a/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/MutableContentClassificationMapImpl.java +++ b/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/map/MutableContentClassificationMapImpl.java @@ -21,10 +21,8 @@ import java.util.LinkedList; import java.util.Map.Entry; -import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; import org.apache.commons.io.output.CloseShieldOutputStream; -import org.apache.commons.lang.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -36,8 +34,6 @@ */ public class MutableContentClassificationMapImpl extends ContentClassificationMapImpl implements MutableContentClassificationMap { - private static final CSVFormat CSV_FORMAT = CSVFormat.RFC4180.withCommentMarker('#'); - public MutableContentClassificationMapImpl(@NotNull String label) { super(label); } @@ -56,7 +52,7 @@ public void write(@NotNull OutputStream output) throws IOException { values.add(entry.getKey()); // resource type values.add(entry.getValue().toString()); String remark = remarkMap.get(entry.getKey()); - if (StringUtils.isNotEmpty(remark)) { + if (remark != null && !remark.isEmpty()) { values.add(remark); } csvPrinter.printRecord(values);