walokra / markdown-page-generator-plugin

Markdown to HTML Page Generator Maven Plugin
MIT License
56 stars 48 forks source link

Paths relative to parent module in multi module #31

Open pauldaustin opened 6 years ago

pauldaustin commented 6 years ago

If you have a multi module project and define the use of this plugin in a sub-module only it fails to find the docs

module-a/
  pom.xml -- plugin defined here
  docs/
    file.md

When you run man install on the root project:

The following looks for /docs instead of module-a/docs

      <plugin>
        <groupId>com.ruleoftech</groupId>
        <artifactId>markdown-page-generator-plugin</artifactId>
        <version>2.1.0</version>
         <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputDirectory>docs</inputDirectory>
              <outputDirectory>target/docs</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

Same also for the output directory

walokra commented 3 years ago

Thanks for reporting the issue.

I'll see if I've time to add this feature to the plugin but Pull Request is welcomed :)

jodygarnett commented 3 years ago

I am confused with your description, as I set up exactly this relationship in the geotools codebase here:

I used the following configuration consistent with the plugin documentation (where it indicates the default is ${project.basedir}/src/main/resources/markdown/):

          <execution>
            <id>readme</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputDirectory>${project.basedir}/src/markdown</inputDirectory>
              <outputDirectory>${project.build.directory}/html</outputDirectory>
            </configuration>
          </execution>

Perhaps you can use ${project.basedir} as a workaround for this issue as shown above?