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