@@ -103,7 +103,8 @@ public void projectDiscoveryStarted(ExecutionEvent event) {
103
103
104
104
@ Override
105
105
public void sessionStarted (ExecutionEvent event ) {
106
- try {
106
+ try
107
+ {
107
108
logger .info ("Initializing Artifactory Build-Info Recording" );
108
109
buildInfoBuilder = buildInfoModelPropertyResolver .resolveProperties (event , conf );
109
110
deployableArtifactBuilderMap = Maps .newHashMap ();
@@ -118,10 +119,12 @@ public void sessionStarted(ExecutionEvent event) {
118
119
if (wrappedListener != null ) {
119
120
wrappedListener .sessionStarted (event );
120
121
}
121
- } catch (Throwable t ) {
122
+ }
123
+ catch ( Throwable t )
124
+ {
122
125
String message = getClass ().getName () + ".sessionStarted() listener has failed: " ;
123
- logger .error (message , t );
124
- throw new RuntimeException (message , t );
126
+ logger .error ( message , t );
127
+ throw new RuntimeException ( message , t );
125
128
}
126
129
}
127
130
@@ -132,17 +135,20 @@ public void sessionEnded(ExecutionEvent event) {
132
135
if (build != null ) {
133
136
File basedir = event .getSession ().getTopLevelProject ().getBasedir ();
134
137
conf .persistToPropertiesFile ();
135
- buildDeploymentHelper .deploy (build , conf , deployableArtifactBuilderMap , projectHasTestFailures , basedir );
138
+ buildDeploymentHelper .deploy (build , conf , deployableArtifactBuilderMap , projectHasTestFailures ,basedir );
136
139
}
137
140
deployableArtifactBuilderMap .clear ();
138
141
if (wrappedListener != null ) {
139
142
wrappedListener .sessionEnded (event );
140
143
}
141
- } catch (Throwable t ) {
144
+ }
145
+ catch ( Throwable t )
146
+ {
142
147
String message = getClass ().getName () + ".sessionEnded() listener has failed: " ;
143
- logger .error (message , t );
144
- throw new RuntimeException (message , t );
145
- } finally {
148
+ logger .error ( message , t );
149
+ throw new RuntimeException ( message , t );
150
+ }
151
+ finally {
146
152
String propertyFilePath = System .getenv (BuildInfoConfigProperties .PROP_PROPS_FILE );
147
153
if (StringUtils .isNotBlank (propertyFilePath )) {
148
154
File file = new File (propertyFilePath );
@@ -448,9 +454,9 @@ private void addArtifactsToCurrentModule(MavenProject project, ModuleBuilder mod
448
454
String groupId = moduleArtifact .getGroupId ();
449
455
String deploymentPath = getDeploymentPath (groupId , artifactId , artifactVersion , artifactClassifier , artifactExtension );
450
456
// If excludeArtifactsFromBuild and the PatternMatcher found conflict, add the excluded artifact to the excluded artifact set.
451
- if (excludeArtifactsFromBuild && PatternMatcher .pathConflicts (deploymentPath , patterns )) {
457
+ if (excludeArtifactsFromBuild && PatternMatcher .pathConflicts (deploymentPath ,patterns )){
452
458
module .addExcludedArtifact (artifact );
453
- } else {
459
+ }else {
454
460
module .addArtifact (artifact );
455
461
}
456
462
if (isPublishArtifacts (artifactFile )) {
@@ -470,9 +476,9 @@ private void addArtifactsToCurrentModule(MavenProject project, ModuleBuilder mod
470
476
artifactBuilder .name (pomFileName );
471
477
org .jfrog .build .api .Artifact pomArtifact = artifactBuilder .build ();
472
478
deploymentPath = getDeploymentPath (groupId , artifactId , artifactVersion , artifactClassifier , "pom" );
473
- if (excludeArtifactsFromBuild && PatternMatcher .pathConflicts (deploymentPath , patterns )) {
479
+ if (excludeArtifactsFromBuild && PatternMatcher .pathConflicts (deploymentPath ,patterns )){
474
480
module .addExcludedArtifact (pomArtifact );
475
- } else {
481
+ }else {
476
482
module .addArtifact (pomArtifact );
477
483
}
478
484
if (isPublishArtifacts (pomFile )) {
@@ -522,7 +528,7 @@ private void addDeployableArtifact(org.jfrog.build.api.Artifact artifact, File a
522
528
/**
523
529
* @param deployPath the full path string to extract the repo from
524
530
* @return Return the target deployment repository. Either the releases repository (default) or snapshots if defined
525
- * and the deployed file is a snapshot.
531
+ * and the deployed file is a snapshot.
526
532
*/
527
533
public String getTargetRepository (String deployPath ) {
528
534
String snapshotsRepository = conf .publisher .getSnapshotRepoKey ();
@@ -598,7 +604,7 @@ public Build extract(ExecutionEvent event) {
598
604
if (conf .isIncludeEnvVars ()) {
599
605
Properties envProperties = new Properties ();
600
606
envProperties .putAll (conf .getAllProperties ());
601
- envProperties = BuildInfoExtractorUtils .getEnvProperties (envProperties , conf . getLog () );
607
+ envProperties = BuildInfoExtractorUtils .getEnvProperties (envProperties );
602
608
for (Map .Entry <Object , Object > envProp : envProperties .entrySet ()) {
603
609
buildInfoBuilder .addProperty (envProp .getKey (), envProp .getValue ());
604
610
}
0 commit comments