Skip to content

Commit

Permalink
Skip collecting pom if not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Dec 11, 2023
1 parent b822ba3 commit 8936285
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,17 +513,19 @@ private void addArtifactsToCurrentModule(MavenProject project, ModuleBuilder mod
}
}
}
/*
* In case of non packaging Pom project module, we need to create the pom file from the project's Artifact
*/

// In case of non-pom packaging, add the pom file from the project's artifacts, if exist
if (!pomFileAdded) {
addPomArtifact(project, module, patterns, excludeArtifactsFromBuild);
addPomArtifactIfExist(project, module, patterns, excludeArtifactsFromBuild);
}
}

private void addPomArtifact(MavenProject project, ModuleBuilder module,
IncludeExcludePatterns patterns, boolean excludeArtifactsFromBuild) {
private void addPomArtifactIfExist(MavenProject project, ModuleBuilder module,
IncludeExcludePatterns patterns, boolean excludeArtifactsFromBuild) {
File pomFile = project.getFile();
if (pomFile == null || !pomFile.exists()) {
return;
}
Artifact projectArtifact = project.getArtifact();
String artifactName = getArtifactName(projectArtifact.getArtifactId(), projectArtifact.getBaseVersion(), projectArtifact.getClassifier(), "pom");
org.jfrog.build.extractor.ci.Artifact pomArtifact = new ArtifactBuilder(artifactName)
Expand Down

0 comments on commit 8936285

Please sign in to comment.