Skip to content

Commit db28096

Browse files
authored
Remove commons-collections and use Multimap from build-info (#116)
1 parent 82ebdc2 commit db28096

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ repositories {
1515
mavenCentral()
1616
}
1717

18-
val buildInfoVersion = "2.41.18"
18+
val buildInfoVersion = "2.41.21"
1919
val fileSpecsVersion = "1.1.2"
20-
val commonsCollections4Version = "4.4"
2120
val commonsLangVersion = "3.12.0"
2221
val commonsIoVersion = "2.11.0"
2322
val commonsTxtVersion = "1.10.0"
@@ -41,7 +40,6 @@ dependencies {
4140
api("org.jfrog.buildinfo", "build-info-client", buildInfoVersion)
4241
api("org.jfrog.filespecs", "file-specs-java", fileSpecsVersion)
4342

44-
implementation("org.apache.commons", "commons-collections4", commonsCollections4Version)
4543
implementation("org.apache.commons", "commons-lang3", commonsLangVersion)
4644
implementation("org.apache.ivy", "ivy", "2.5.2")
4745

src/main/java/org/jfrog/gradle/plugin/artifactory/task/ArtifactoryTask.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package org.jfrog.gradle.plugin.artifactory.task;
22

33
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4-
import org.apache.commons.collections4.MultiMapUtils;
5-
import org.apache.commons.collections4.MultiValuedMap;
64
import org.apache.commons.lang3.StringUtils;
75
import org.gradle.api.*;
86
import org.gradle.api.artifacts.Configuration;
@@ -20,6 +18,8 @@
2018
import org.gradle.api.tasks.Optional;
2119
import org.gradle.api.tasks.*;
2220
import org.jfrog.build.api.builder.ModuleType;
21+
import org.jfrog.build.api.multiMap.Multimap;
22+
import org.jfrog.build.api.multiMap.SetMultimap;
2323
import org.jfrog.build.extractor.clientConfiguration.ArtifactSpecs;
2424
import org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration;
2525
import org.jfrog.gradle.plugin.artifactory.Constant;
@@ -51,7 +51,7 @@ public class ArtifactoryTask extends DefaultTask {
5151
// Publication containers input
5252
private final Set<Object> publications = new HashSet<>();
5353
// Properties input
54-
private final MultiValuedMap<String, CharSequence> properties = MultiMapUtils.newSetValuedHashMap();
54+
private final Multimap<String, CharSequence> properties = new SetMultimap<>();
5555
@Input
5656
public final ArtifactSpecs artifactSpecs = new ArtifactSpecs();
5757

@@ -394,7 +394,7 @@ public Set<Publication> getPublications() {
394394
}
395395

396396
@Input
397-
public MultiValuedMap<String, CharSequence> getProperties() {
397+
public Multimap<String, CharSequence> getProperties() {
398398
return properties;
399399
}
400400

src/main/java/org/jfrog/gradle/plugin/artifactory/utils/PublicationUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.jfrog.gradle.plugin.artifactory.utils;
22

3-
import org.apache.commons.collections4.MultiValuedMap;
43
import org.apache.commons.lang3.StringUtils;
54
import org.apache.ivy.core.IvyPatternHelper;
65
import org.gradle.api.GradleException;
@@ -14,6 +13,7 @@
1413
import org.gradle.api.publish.ivy.plugins.IvyPublishPlugin;
1514
import org.gradle.api.publish.maven.MavenPublication;
1615
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
16+
import org.jfrog.build.api.multiMap.Multimap;
1717
import org.jfrog.build.api.util.FileChecksumCalculator;
1818
import org.jfrog.build.extractor.clientConfiguration.ArtifactSpec;
1919
import org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration;
@@ -201,12 +201,12 @@ private static Map<String, String> getPropsToAdd(ArtifactoryTask destination, Pu
201201
.name(project.getName()).version(project.getVersion().toString())
202202
.classifier(artifact.getClassifier())
203203
.type(artifact.getType()).build();
204-
MultiValuedMap<String, CharSequence> artifactSpecsProperties = destination.artifactSpecs.getProperties(spec);
204+
Multimap<String, CharSequence> artifactSpecsProperties = destination.artifactSpecs.getProperties(spec);
205205
addProps(propsToAdd, artifactSpecsProperties);
206206
return propsToAdd;
207207
}
208208

209-
public static void addProps(Map<String, String> target, MultiValuedMap<String, CharSequence> props) {
209+
public static void addProps(Map<String, String> target, Multimap<String, CharSequence> props) {
210210
for (Map.Entry<String, CharSequence> entry : props.entries()) {
211211
// Make sure all GString are now Java Strings
212212
String key = entry.getKey();

0 commit comments

Comments
 (0)