ljnelson commented on code in PR #104:
URL:
https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1162025140
##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java:
##########
@@ -911,6 +924,29 @@ private File resolveSiteDescriptor(
return siteDescriptor;
}
+ // TODO Remove this transient method when everyone has migrated to Maven
Site Plugin 4.0.0+
+ private void deletePseudoSiteDescriptorMarkerFile(RepositorySystemSession
repoSession, ArtifactRequest request) {
+ LocalRepositoryManager lrm = repoSession.getLocalRepositoryManager();
+
+ LocalArtifactRequest localRequest = new LocalArtifactRequest();
+ localRequest.setArtifact(request.getArtifact());
+
+ LocalArtifactResult localResult = lrm.find(repoSession, localRequest);
+ File localArtifactFile = localResult.getFile();
+
+ try {
+ if (localResult.isAvailable() &&
Files.size(localArtifactFile.toPath()) == 0L) {
+ LOGGER.debug(
+ "Deleting 0-byte pseudo marker file for artifact '{}'
at '{}'",
+ localRequest.getArtifact(),
+ localArtifactFile);
+ Files.delete(localArtifactFile.toPath());
+ }
+ } catch (IOException e) {
+ LOGGER.debug("Failed to delete 0-byte pseudo marker file for
artifact '{}'", localRequest.getArtifact());
Review Comment:
Shouldn't you include the exception itself as well? Or maybe that's not the
convention, I don't know. Anyway, some logging is better than no logging!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]