Skip to content

Commit 93babfb

Browse files
authored
revert d4ae15a..ae15936 (#574)
* Revert "Bugfix - Build-info ignores duplicate artifacts checksum (#560)" This reverts commit ae15936. * Revert "Update RELEASE.md" This reverts commit 9092072. * Revert "[artifactory-release] Next development version [skipRun]" This reverts commit a304335. * Revert "[artifactory-release] Release version 2.31.3 [skipRun]" This reverts commit fffdb51. * Revert "Fix failing tests caused by removing 'artifactory.' " This reverts commit e067c9d. * Revert "Deprecate 'artifactory.' properties prefix (#570)" This reverts commit 8e6da85. * Revert "Use the latest release of the Gradle plugin (#566)" This reverts commit 04398a4.
1 parent ae15936 commit 93babfb

13 files changed

Lines changed: 54 additions & 109 deletions

File tree

RELEASE.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
# Release Notes
2-
## build-info-extractor 2.31.3 / gradle-artifactory-plugin 4.24.22 (November 10, 2021)
3-
- Use the latest release of the Gradle Artifactory plugin. ([566](https://github.com/jfrog/build-info/pull/566))
4-
- Deprecate 'artifactory.' properties prefix ([570](https://github.com/jfrog/build-info/pull/570))
5-
62
## build-info-extractor 2.31.2 / gradle-artifactory-plugin 4.24.21 (November 3, 2021)
73
- Add CVE ID to Xray scan Issue ([564](https://github.com/jfrog/build-info/pull/564))
84
- Improve dependency tree performance and memory consumption ([562](https://github.com/jfrog/build-info/pull/562)) ([565](https://github.com/jfrog/build-info/pull/565))

build-info-api/src/main/java/org/jfrog/build/api/Artifact.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.jfrog.build.api;
1818

1919
import com.thoughtworks.xstream.annotations.XStreamAlias;
20-
import org.apache.commons.lang.StringUtils;
2120

2221
/**
2322
* Contains the build deployed artifact information
@@ -60,7 +59,10 @@ public boolean equals(Object o) {
6059
}
6160

6261
Artifact artifact = (Artifact) o;
63-
return StringUtils.equals(name, artifact.name) && StringUtils.equals(remotePath, artifact.remotePath);
62+
if (name != null ? !name.equals(artifact.name) : artifact.name != null) {
63+
return false;
64+
}
65+
return true;
6466
}
6567

6668
@Override

build-info-api/src/main/java/org/jfrog/build/api/BaseBuildFileBean.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public int hashCode() {
111111
result = 31 * result + (sha1 != null ? sha1.hashCode() : 0);
112112
result = 31 * result + (sha256 != null ? sha256.hashCode() : 0);
113113
result = 31 * result + (md5 != null ? md5.hashCode() : 0);
114-
result = 31 * result + (remotePath != null ? remotePath.hashCode() : 0);
115114
return result;
116115
}
117116
}

build-info-api/src/main/java/org/jfrog/build/api/Dependency.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import com.thoughtworks.xstream.annotations.XStreamAlias;
2020
import org.apache.commons.lang.ArrayUtils;
21-
import org.apache.commons.lang.StringUtils;
2221

2322
import java.util.Arrays;
2423
import java.util.Objects;
@@ -122,10 +121,7 @@ public boolean equals(Object o) {
122121
}
123122
Dependency that = (Dependency) o;
124123

125-
if (!StringUtils.equals(id, that.id)) {
126-
return false;
127-
}
128-
if (!StringUtils.equals(remotePath, that.remotePath)) {
124+
if (!Objects.equals(id, that.id)) {
129125
return false;
130126
}
131127
if (!Objects.equals(scopes, that.scopes)) {
@@ -136,6 +132,6 @@ public boolean equals(Object o) {
136132

137133
@Override
138134
public int hashCode() {
139-
return Objects.hash(id, scopes, Arrays.deepHashCode(requestedBy), remotePath);
135+
return Objects.hash(id, scopes, Arrays.deepHashCode(requestedBy));
140136
}
141137
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Deployer settings
2-
publish.publications=${publications}
3-
publish.contextUrl=${contextUrl}
4-
publish.repoKey=${localRepo}
5-
publish.username=${username}
6-
publish.password=${password}
7-
publish.unstable=false
8-
publish.buildInfo=true
9-
publish.maven=true
10-
publish.ivy=true
2+
artifactory.publish.publications=${publications}
3+
artifactory.publish.contextUrl=${contextUrl}
4+
artifactory.publish.repoKey=${localRepo}
5+
artifactory.publish.username=${username}
6+
artifactory.publish.password=${password}
7+
artifactory.publish.unstable=false
8+
artifactory.publish.buildInfo=true
9+
artifactory.publish.maven=true
10+
artifactory.publish.ivy=true
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Resolver settings
2-
resolve.contextUrl=${contextUrl}
3-
resolve.repoKey=${virtualRepo}
4-
resolve.username=${username}
5-
resolve.password=${password}
2+
artifactory.resolve.contextUrl=${contextUrl}
3+
artifactory.resolve.repoKey=${virtualRepo}
4+
artifactory.resolve.username=${username}
5+
artifactory.resolve.password=${password}

build-info-extractor-maven3/src/main/java/org/jfrog/build/extractor/maven/BuildDeploymentHelper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ public void deploy( Build build,
6060
logger.debug("Build Info Recorder: publication fork count: " + clientConf.publisher.getPublishForkCount());
6161
logger.debug("Build Info Recorder: publish build info: " + clientConf.publisher.isPublishBuildInfo());
6262

63+
64+
if (clientConf.publisher.isPublishBuildInfo() || StringUtils.isNotBlank(clientConf.info.getGeneratedBuildInfoFilePath())) {
65+
saveBuildInfoToFile(build, clientConf, basedir);
66+
}
67+
6368
if (!StringUtils.isEmpty(clientConf.info.getGeneratedBuildInfoFilePath())) {
6469
try {
6570
BuildInfoExtractorUtils.saveBuildInfoToFile(build, new File(clientConf.info.getGeneratedBuildInfoFilePath()));

build-info-extractor-maven3/src/main/java/org/jfrog/build/extractor/maven/BuildInfoRecorder.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ private void addArtifactsToCurrentModule(MavenProject project, ModuleBuilder mod
530530
if (artifactFile != null && artifactFile.isFile()) {
531531
boolean pathConflicts = PatternMatcher.pathConflicts(deploymentPath, patterns);
532532
addArtifactToBuildInfo(artifact, pathConflicts, excludeArtifactsFromBuild, module);
533-
if (conf.publisher.isPublishArtifacts()) {
534-
addDeployableArtifact(artifact, artifactFile, pathConflicts, groupId, artifactId, artifactVersion, artifactClassifier, artifactExtension);
535-
}
533+
addDeployableArtifact(artifact, artifactFile, pathConflicts, groupId, artifactId, artifactVersion, artifactClassifier, artifactExtension);
536534
}
537535
}
538536
/*
@@ -563,9 +561,7 @@ private void addPomArtifact(Artifact nonPomArtifact, ModuleBuilder module,
563561
if (pomFile != null && pomFile.isFile()) {
564562
boolean pathConflicts = PatternMatcher.pathConflicts(deploymentPath, patterns);
565563
addArtifactToBuildInfo(pomArtifact, pathConflicts, excludeArtifactsFromBuild, module);
566-
if (conf.publisher.isPublishArtifacts()) {
567-
addDeployableArtifact(pomArtifact, pomFile, pathConflicts, nonPomArtifact.getGroupId(), nonPomArtifact.getArtifactId(), nonPomArtifact.getVersion(), nonPomArtifact.getClassifier(), "pom");
568-
}
564+
addDeployableArtifact(pomArtifact, pomFile, pathConflicts, nonPomArtifact.getGroupId(), nonPomArtifact.getArtifactId(), nonPomArtifact.getVersion(), nonPomArtifact.getClassifier(), "pom");
569565
}
570566
break;
571567
}

build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/ClientProperties.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,57 +28,57 @@ public interface ClientProperties {
2828
* top level property.
2929
*/
3030
@Deprecated
31-
String PROP_CONTEXT_URL = "contextUrl";
31+
String PROP_CONTEXT_URL = ARTIFACTORY_PREFIX + "contextUrl";
3232

33-
String PROP_CONNECTION_RETRIES = "connectionRetries";
33+
String PROP_CONNECTION_RETRIES = ARTIFACTORY_PREFIX + "connectionRetries";
3434

35-
String PROP_TIMEOUT = "timeout";
35+
String PROP_TIMEOUT = ARTIFACTORY_PREFIX + "timeout";
3636

37-
String PROP_SO_TIMEOUT = "timeout.socket";
37+
String PROP_SO_TIMEOUT = ARTIFACTORY_PREFIX + "timeout.socket";
3838

39-
String PROP_MAX_CO_PER_ROUTE = "maxConPerRoute";
39+
String PROP_MAX_CO_PER_ROUTE = ARTIFACTORY_PREFIX + "maxConPerRoute";
4040

41-
String PROP_MAX_TOTAL_CO = "maxTotalCon";
41+
String PROP_MAX_TOTAL_CO = ARTIFACTORY_PREFIX + "maxTotalCon";
4242

43-
String PROP_PROXY_PREFIX = "proxy.";
43+
String PROP_PROXY_PREFIX = ARTIFACTORY_PREFIX + "proxy.";
4444

45-
String PROP_PACKAGE_MANAGER_PREFIX = "package.manager.";
45+
String PROP_PACKAGE_MANAGER_PREFIX = ARTIFACTORY_PREFIX + "package.manager.";
4646

47-
String PROP_NPM_PREFIX = "npm.";
47+
String PROP_NPM_PREFIX = ARTIFACTORY_PREFIX + "npm.";
4848

49-
String PROP_PIP_PREFIX = "pip.";
49+
String PROP_PIP_PREFIX = ARTIFACTORY_PREFIX + "pip.";
5050

51-
String PROP_DOTNET_PREFIX = "dotnet.";
51+
String PROP_DOTNET_PREFIX = ARTIFACTORY_PREFIX + "dotnet.";
5252

53-
String PROP_DOCKER_PREFIX = "docker.";
53+
String PROP_DOCKER_PREFIX = ARTIFACTORY_PREFIX + "docker.";
5454

55-
String PROP_KANIKO_PREFIX = "kaniko.";
55+
String PROP_KANIKO_PREFIX = ARTIFACTORY_PREFIX + "kaniko.";
5656

57-
String PROP_GO_PREFIX = "go.";
57+
String PROP_GO_PREFIX = ARTIFACTORY_PREFIX + "go.";
5858

5959
/**
6060
* The repo key in Artifactory from where to resolve artifacts.
6161
*/
62-
String PROP_RESOLVE_PREFIX = "resolve.";
62+
String PROP_RESOLVE_PREFIX = ARTIFACTORY_PREFIX + "resolve.";
6363

6464
/**
6565
* The repo key in Artifactory to where to publish release artifacts.
6666
*/
67-
String PROP_PUBLISH_PREFIX = "publish.";
67+
String PROP_PUBLISH_PREFIX = ARTIFACTORY_PREFIX + "publish.";
6868

6969
/**
7070
* Property for whether to publish the artifacts even if the build is unstable
7171
*/
72-
String PROP_PUBLISH_EVEN_UNSTABLE = "publish.unstable";
72+
String PROP_PUBLISH_EVEN_UNSTABLE = ARTIFACTORY_PREFIX + "publish.unstable";
7373

7474

7575
/**
7676
* Prefix for properties that are dynamically added to deployment (as matrix params)
7777
*/
78-
String PROP_DEPLOY_PARAM_PROP_PREFIX = "deploy.";
78+
String PROP_DEPLOY_PARAM_PROP_PREFIX = ARTIFACTORY_PREFIX + "deploy.";
7979

8080
/**
8181
* Property for whether to use relaxed ssl check and ignore issues with server certificate
8282
*/
83-
String PROP_INSECURE_TLS = "insecureTls";
83+
String PROP_INSECURE_TLS = ARTIFACTORY_PREFIX + "insecureTls";
8484
}

build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/util/DependenciesDownloaderHelper.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,9 @@
2121
import org.jfrog.filespecs.FileSpec;
2222
import org.jfrog.filespecs.entities.FilesGroup;
2323

24-
import java.io.File;
25-
import java.io.FileInputStream;
26-
import java.io.FileNotFoundException;
27-
import java.io.FileOutputStream;
28-
import java.io.IOException;
29-
import java.io.InputStream;
30-
import java.io.PrintWriter;
31-
import java.io.SequenceInputStream;
32-
import java.io.StringWriter;
24+
import java.io.*;
3325
import java.security.NoSuchAlgorithmException;
34-
import java.util.ArrayList;
35-
import java.util.HashMap;
36-
import java.util.HashSet;
37-
import java.util.List;
38-
import java.util.Map;
39-
import java.util.Set;
26+
import java.util.*;
4027
import java.util.regex.Pattern;
4128

4229
import static org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.Upload.MD5_HEADER_NAME;
@@ -75,7 +62,7 @@ public DependenciesDownloaderHelper(ArtifactoryManager artifactoryManager, Strin
7562

7663
/**
7764
* Download dependencies by the provided spec using the provided in the constructor client.
78-
* returns a distinct list of downloaded artifacts
65+
* returns list of downloaded artifacts
7966
*
8067
* @param downloadSpec the download spec
8168
* @return list of downloaded artifacts
@@ -85,7 +72,7 @@ public List<Dependency> downloadDependencies(FileSpec downloadSpec) throws IOExc
8572
ArtifactorySearcher searcher = new ArtifactorySearcher(downloader.getArtifactoryManager(), log);
8673
Set<DownloadableArtifact> downloadableArtifacts;
8774
List<AqlSearchResult.SearchEntry> searchResults;
88-
HashSet<Dependency> resolvedDependencies = new HashSet<>();
75+
List<Dependency> resolvedDependencies = new ArrayList<>();
8976

9077
for (FilesGroup file : downloadSpec.getFiles()) {
9178
log.debug("Downloading dependencies using spec: \n" + file.toString());
@@ -97,7 +84,7 @@ public List<Dependency> downloadDependencies(FileSpec downloadSpec) throws IOExc
9784
}
9885
resolvedDependencies.addAll(downloadDependencies(downloadableArtifacts));
9986
}
100-
return new ArrayList<>(resolvedDependencies);
87+
return resolvedDependencies;
10188
}
10289

10390
private void replaceTargetPlaceholders(String searchPattern, Set<DownloadableArtifact> downloadableArtifacts, String target) {

0 commit comments

Comments
 (0)