Search code examples
mavenmaven-site-plugin

changing maven site plugin source folder


I need to change the maven site documentation source folder. I've check the plugin documentation and couldn't find this configuration.

Problem scenario:

I have a maven project with several child project, and one of this child is only a angular2 project.

On the angular project, the source folder has the pom.xml and several angular files, and one of the folder used by angular is 'src' (which is there the components, services, etc are stored).

I need to add maven site to this project, and it look the source files into 'src/site/*'. This works, but this 'site' folder is mixed with several ts files, and this looks messy, so I need to change the default folder for maven site plugin.

current folders scenario

Is there any way to change it?


Solution

  • If you wish to change the source directory in which Maven looks for, although I would rather recommend to clean your directory, I think what's below should work:

     <build>
          ....
          <plugins>
           ....
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.4</version>
                <configuration>
                    <siteDirectory>my/site/dir</siteDirectory>
                </configuration>
            </plugin>
           ....
          </plugins>
          ....
       </build>