Skip to content

Commit

Permalink
Fix CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Or-Geva committed Mar 16, 2022
1 parent 25a7862 commit 90f5a7f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void sessionStarted(ExecutionEvent event) {
logger.info("Initializing Artifactory Build-Info Recording");
buildInfoBuilder = buildInfoModelPropertyResolver.resolveProperties(event, conf);
deployableArtifactBuilderMap = new ConcurrentHashMap<>();
skipDeploy(event);
setDeploymentPolicy(event);

if (wrappedListener != null) {
wrappedListener.sessionStarted(event);
Expand Down Expand Up @@ -729,9 +729,10 @@ private void cleanUpModule() {
}

/**
* Skip the default maven deploy behaviour.
* Only Maven deploy / install goals are supposed to upload artifacts to artifactory.
* Other than that, we don't upload artifacts.
*/
private void skipDeploy(ExecutionEvent event) {
private void setDeploymentPolicy(ExecutionEvent event) {
List<String> goals = event.getSession().getRequest().getGoals();
// Override the default Maven deploy behavior with Artifactory.
if (goals.contains("deploy")) {
Expand All @@ -740,7 +741,8 @@ private void skipDeploy(ExecutionEvent event) {
}
// Skip the artifact deployment behavior if the goals do not contain install phases.
if (!goals.contains("install")) {
this.conf.publisher.setBooleanValue(ADD_DEPLOYABLE_ARTIFACTS, false);
conf.publisher.setPublishArtifacts(false);
conf.publisher.setPublishBuildInfo(false);
}
}
}

0 comments on commit 90f5a7f

Please sign in to comment.