ljnelson commented on code in PR #104:
URL:
https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1162003386
##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java:
##########
@@ -911,6 +924,27 @@ 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) {
+ LocalRepository localRepository = repoSession.getLocalRepository();
+ LocalRepositoryManager lrm = repoSession.getLocalRepositoryManager();
+
+ String relativeLocalArtifactPath =
lrm.getPathForLocalArtifact(request.getArtifact());
+ Path localArtifactPath =
localRepository.getBasedir().toPath().resolve(relativeLocalArtifactPath);
+
+ try {
+ if (Files.exists(localArtifactPath) &&
Files.size(localArtifactPath) == 0L) {
+ LOGGER.debug(
+ "Deleting 0-byte pseudo marker file for artifact '{}'
at '{}'",
+ request.getArtifact(),
+ localArtifactPath);
+ Files.delete(localArtifactPath);
+ }
+ } catch (IOException e) {
+ // swallow
Review Comment:
Perhaps a permissions error occurred during deletion? Perhaps acquiring the
file size failed in some way? If things like this happen, I would certainly
want to know about them. I've rarely seen a case where swallowing an exception
is a good thing to do, but I'm not deeply familiar with the practices of Maven
plugins and such.
--
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]