Skip to content

Commit

Permalink
[FIXED JENKINS-10472] take care of builds which don't produce artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
olamy committed Aug 3, 2011
1 parent 2c26781 commit 1cf091c
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -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()));
}
Expand All @@ -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()));
}
}
Expand Down

0 comments on commit 1cf091c

Please sign in to comment.