You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "michael-o (via GitHub)" <gi...@apache.org> on 2023/04/10 18:32:28 UTC

[GitHub] [maven-doxia-sitetools] michael-o opened a new pull request, #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

michael-o opened a new pull request, #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104

   … from the local repo
   
   This solution is not forever and is *not* concurrency-safe since we cannot obtain a sync context for it.
   
   This closes #104


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] ljnelson commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "ljnelson (via GitHub)" <gi...@apache.org>.
ljnelson commented on code in PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1161993705


##########
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:
   Eek; at least log at debug level?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] michael-o commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1161994951


##########
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:
   What would be the improvement if I log this here?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] ljnelson commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "ljnelson (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] asfgit closed pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…
URL: https://github.com/apache/maven-doxia-sitetools/pull/104


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] ljnelson commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "ljnelson (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] michael-o commented on pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#issuecomment-1502208174

   @kwin @ljnelson Please have a look again, rewritten with the canonical request/result style.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] michael-o commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1161994951


##########
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:
   What wouls be the improvement if I log this here?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] michael-o commented on pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#issuecomment-1502188433

   > LGTM, not sure though if additional cleanup in the metadata is necessary as well….
   
   Good question because this leads to the problem that we need to deal with Resolver internal files which I don't really want to do. This may be something: `org.eclipse.aether.resolution.MetadataRequest.setDeleteLocalCopyIfMissing(boolean)`
   LRM does not offer a delete. My solution isn't really good since `org.eclipse.aether.repository.LocalRepositoryManager.find(RepositorySystemSession, LocalArtifactRequest)` is the better alternative. Let me rewrite the code.
   
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] michael-o commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1162026996


##########
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:
   Stupid me, it is late and  I am not fresh anymore ;-)



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] ljnelson commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "ljnelson (via GitHub)" <gi...@apache.org>.
ljnelson commented on code in PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1162030475


##########
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:
   No problem. Looks like you've added the exception so I'm all set.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] michael-o commented on pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#issuecomment-1502211312

   Output:
   ```
   [DEBUG] Reading parent level 1 site descriptor from C:\Users\mosipov\.m2\repository\org\apache\maven\maven-parent\40-SNAPSHOT\maven-parent-40-SNAPSHOT-site.xml
   [DEBUG] Looking for site descriptor of level 2 parent project: org.apache:apache:pom:29
   [DEBUG] Deleting 0-byte pseudo marker file for artifact 'org.apache:apache:xml:site:29' at 'C:\Users\mosipov\.m2\repository\org\apache\apache\29\apache-29-site.xml'
   [DEBUG] Resolving artifact org.apache:apache:xml:site:29 from [apache.snapshots (https://repository.apache.org/snapshots, default, snapshots), apache.staging (https://repository.apache.org/content/repositories/maven-1752/, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
   [DEBUG] No site descriptor found for 'org.apache:apache:pom:29' with default locale
   [DEBUG] Unable to locate site descriptor
   org.eclipse.aether.transfer.ArtifactNotFoundException: org.apache:apache:xml:site:29 was not found in https://repository.apache.org/content/repositories/maven-1752/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of apache.staging has elapsed or updates are forced
       at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException (DefaultUpdateCheckManager.java:217)
       at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact (DefaultUpdateCheckManager.java:189)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads (DefaultArtifactResolver.java:574)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:484)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:402)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:207)
       at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:262)
       at org.apache.maven.doxia.tools.DefaultSiteTool.resolveSiteDescriptor (DefaultSiteTool.java:911)
       at org.apache.maven.doxia.tools.DefaultSiteTool.getSiteDescriptorFromRepository (DefaultSiteTool.java:361)
       at org.apache.maven.doxia.tools.DefaultSiteTool.getSiteModel (DefaultSiteTool.java:975)
       at org.apache.maven.doxia.tools.DefaultSiteTool.getSiteModel (DefaultSiteTool.java:1031)
       at org.apache.maven.doxia.tools.DefaultSiteTool.getSiteModel (DefaultSiteTool.java:1031)
       at org.apache.maven.doxia.tools.DefaultSiteTool.getSiteModel (DefaultSiteTool.java:391)
       at org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo.prepareSiteModel (AbstractSiteDescriptorMojo.java:91)
       at org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo.createSiteRenderingContext (AbstractSiteRenderingMojo.java:240)
       at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:139)
       at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:124)
       at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
       at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
       at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
       at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
       at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
       at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
       at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
       at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
       at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
       at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
       at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
       at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
       at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
       at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
       at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
       at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
       at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke (Method.java:498)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
       at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
       at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
   [DEBUG] No parent level 2 site descriptor
   [DEBUG] Site model inheritance: assembling child with level 2 parent: distributionManagement.site.url child = file:/D:/Entwicklung/Projekte/maven-site/scm:svn:https:/svn.apache.org/repos/asf/maven/website/.. and parent = null
   [DEBUG] Site model inheritance: assembling child with level 1 parent: distributionManagement.site.url child = file:/D:/Entwicklung/Projekte/maven-site/scm:svn:https:/svn.apache.org/repos/asf/maven/website/content and parent = file:/D:/Entwicklung/Projekte/maven-site/scm:svn:https:/svn.apache.org/repos/asf/maven/website/..
   [INFO] Relativizing site links with respect to localized project URL: https://maven.apache.org/
   [INFO] Rendering content with org.apache.maven.skins:maven-fluido-skin:jar:2.0.0-M5 skin.
   [DEBUG] Skin doxia-sitetools prerequisite: 2.0.0-M6, current: 2.0.0-M8-SNAPSHOT, matched = true
   ```


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-doxia-sitetools] michael-o commented on a diff in pull request #104: [DOXIASITETOOLS-301] Automatically remove the 0-byte site descriptors…

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #104:
URL: https://github.com/apache/maven-doxia-sitetools/pull/104#discussion_r1162008256


##########
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:
   I agree with you.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org