Skip to content

Commit

Permalink
common: Log information about why publishing repos were or were not s…
Browse files Browse the repository at this point in the history
…elected
  • Loading branch information
zml2008 committed Jan 4, 2022
1 parent d92498c commit 918fbe2
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,21 @@ private boolean canPublishTo(final Project project, final RemoteRepository repos
final String username = repository.name() + "Username";
final String password = repository.name() + "Password";

if(!project.hasProperty(username)) return false;
if(!project.hasProperty(password)) return false;
if(!project.hasProperty(username) || !project.hasProperty(password)) {
project.getLogger().info("indra-publishing: skipping repository {} because username or password was not set", repository.name());
return false;
}

if(repository.releases() && Versioning.isRelease(project)) return true;
if(repository.snapshots() && Versioning.isSnapshot(project)) return true;
if(repository.releases() && Versioning.isRelease(project)) {
project.getLogger().info("indra-publishing: adding repository {} because it accepts releases and this project is in a release state", repository.name());
return true;
}
if(repository.snapshots() && Versioning.isSnapshot(project)) {
project.getLogger().info("indra-publishing: adding repository {} because it accepts snapshots and this project is in a snapshot state", repository.name());
return true;
}

project.getLogger().info("indra-publishing: skipping repository {} because release/snapshot constraint not met", repository.name());
return false;
}

Expand Down

0 comments on commit 918fbe2

Please sign in to comment.