Skip to content

Unexpected warnings "Duplicated destination found: overwriting file: ..." #728

@kriegaex

Description

@kriegaex

Thank you for taking your time to talk with us!

What is this issue about?

  • Bug report
  • Feature request
  • Question (or bug report, not sure yet)

Description

My POM looks like this:

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.asciidoctor</groupId>
      <artifactId>asciidoctor-maven-plugin</artifactId>
      <version>2.2.4</version>
      <configuration>
        <attributes>
          <source-highlighter>coderay</source-highlighter>
          <toc>left</toc>
          <icons>font</icons>
        </attributes>
      </configuration>
      <!-- TODO: Remove dependency after https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/553 fix -->
      <dependencies>
        <dependency>
          <groupId>org.jruby</groupId>
          <artifactId>jruby</artifactId>
          <version>9.4.5.0</version>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</pluginManagement>

<plugins>
  <plugin>
    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctor-maven-plugin</artifactId>
    <executions>
      <execution>
        <id>create-asciidoc</id>
        <phase>generate-resources</phase>
        <goals>
          <goal>process-asciidoc</goal>
        </goals>
        <configuration>
          <sourceDirectory>${project.basedir}</sourceDirectory>
          <outputDirectory>${project.build.directory}/html</outputDirectory>
          <preserveDirectories>true</preserveDirectories>
          <relativeBaseDir>true</relativeBaseDir>
          <resources>
            <resource>
              <!-- Mandatory, even though identical to 'sourceDirectory' -->
              <directory>${project.basedir}</directory>
              <excludes>
                <!-- Generally excluded file extensions -->
                <exclude>**/*.doc</exclude>
                <exclude>**/*.vsd</exclude>
                <!-- Files excluded in root directory -->
                <exclude>*.iml</exclude>
                <exclude>pom.xml*</exclude>
                <exclude>build.xml</exclude>
                <exclude>docs.build.properties</exclude>
                <!-- Files excluded in subdirectories -->
                <exclude>developer/*.txt</exclude>
                <exclude>developer/ajdt/**</exclude>
                <exclude>developer/traces/**</exclude>
                <exclude>install/**</exclude>
                <exclude>sandbox/**</exclude>
                <exclude>src/**</exclude>
                <exclude>teaching/**</exclude>
                <exclude>test/**</exclude>
              </excludes>
            </resource>
          </resources>
        </configuration>
      </execution>
    </executions>
  </plugin>
</plugins>

There are a few ADOC file in the module root and a few dozen more in several subdirectories. Per subdirectory, there usually is one main ADOC creating a TOC and simply linking to subpages via xref: and another variant of the main ADOC using include::directives. As far as I can see, the output HTML files are created correctly. Anyway, I see several log messages like this:

...
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\devguide\devguide.adoc
[WARNING] Duplicated destination found: overwriting file: C:\Users\alexa\Documents\java-src\AspectJ\docs\index.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\devguide\index.adoc
[WARNING] Duplicated destination found: overwriting file: C:\Users\alexa\Documents\java-src\AspectJ\docs\ltw.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\devguide\ltw.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\devguide\tools-intro.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\examples\spacewar\README.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\faq\faq.adoc
[WARNING] Duplicated destination found: overwriting file: C:\Users\alexa\Documents\java-src\AspectJ\docs\index.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\index.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\LICENSE-AspectJ.adoc
[INFO] Converted C:\Users\alexa\Documents\java-src\AspectJ\docs\pdguide\ajcore.adoc
[WARNING] Duplicated destination found: overwriting file: C:\Users\alexa\Documents\java-src\AspectJ\docs\index.adoc
...

This is irritating for several reasons:

  • The paths in the warnings are from the source directory, not the target directory.
  • The paths are mostly fantasy paths, i.e. while e.g. ltw.adoc exists in several subdirectories, it certainly does not exist directly in the source base path C:\Users\alexa\Documents\java-src\AspectJ\docs´. Only an index.adoc is there (and also in some subdirectories).
  • If anything would be overwritten - which does not seem to be the case - it should be under C:\Users\alexa\Documents\java-src\AspectJ\docs\target\html, as specified in the config.

IMO, the warnings are just false. Even if they were not, the printed fantasy paths do not make any sense. I strongly hope that the plugin does not write any intermediary output into the source folder.

Environment information

  • asciidoctor-maven-plugin version: 2.2.4

  • asciidoctorj version: ?

  • Maven, Java and OS version: Maven 3.6.3, 3.9.5, Java 21, Windows 10 Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions