Skip to content
Permalink
Browse files
[FIXED JENKINS-10472] take care of builds which don't produce artifacts
  • Loading branch information
olamy committed Aug 3, 2011
1 parent 2c26781 commit 1cf091c229736ef40f88a84f43dea45797dc53cf
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/main/java/org/jenkins/plugins/cloudbees/MavenArtifactFilePathSaver.java
@@ -54,11 +54,11 @@ public boolean leaveModule( MavenBuildProxy build, MavenProject pom, BuildListen
public boolean postBuild(MavenBuildProxy build, MavenProject pom, final BuildListener listener) throws InterruptedException, IOException {

listener.getLogger().println("post build " + (pom.getArtifact() != null) + ":" + (pom.getAttachedArtifacts() != null));
if (pom.getArtifact() != null || pom.getAttachedArtifacts() != null) {
if (pom != null && pom.getArtifact() != null || pom.getAttachedArtifacts() != null) {
final Set<MavenArtifactWithFilePath> mavenArtifacts = new HashSet<MavenArtifactWithFilePath>();
if (pom.getArtifact() != null) {
final MavenArtifact mainArtifact = MavenArtifact.create(pom.getArtifact());
if (mainArtifact != null) {
if (mainArtifact != null && pom.getArtifact() != null && pom.getArtifact().getFile() != null) {
//TODO take of NPE !!
mavenArtifacts.add(new MavenArtifactWithFilePath(pom.getGroupId(), pom.getArtifactId(), pom.getVersion(), pom.getArtifact().getFile().getPath(), pom.getArtifact().getType()));
}
@@ -68,8 +68,7 @@ public boolean postBuild(MavenBuildProxy build, MavenProject pom, final BuildLis
final List<MavenArtifact> attachedArtifacts = new ArrayList<MavenArtifact>();
for (Artifact a : pom.getAttachedArtifacts()) {
MavenArtifact ma = MavenArtifact.create(a);
if (ma != null) {
//TODO take of NPE !!
if (ma != null && pom.getArtifact() != null && pom.getArtifact().getFile() != null) {
mavenArtifacts.add(new MavenArtifactWithFilePath(pom.getGroupId(), pom.getArtifactId(), pom.getVersion(), pom.getArtifact().getFile().getPath(), pom.getArtifact().getType()));
}
}

0 comments on commit 1cf091c

Please sign in to comment.