Maven站点中图像的其他资源目录

时间:2017-03-03 16:45:45

标签: java maven asciidoc

对于Maven站点,标准映像目录为src/site/resources/images

不幸的是,我的asciidoc编辑器将图像复制到src/site/asciidoc/images。我可以以某种方式将此目录添加到站点资源(如Maven resources plugin)?

1 个答案:

答案 0 :(得分:1)

要将所有资源复制到outputDirectory,您只需在pom.xml-

中指定以下内容即可
<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.0.2</version>
    <executions>
      <execution>
        <id>copy-resources</id>
        <!-- here the phase you need -->
        <phase>validate</phase>
        <goals>
          <goal>copy-resources</goal>
        </goals>
        <configuration>
          <outputDirectory>${basedir}/src/site/resources/images</outputDirectory>
          <resources>          
            <resource>
              <directory>src/non-packaged-resources</directory>
              <filtering>true</filtering>
            </resource>
          </resources>              
        </configuration>            
      </execution>
    </executions>
  </plugin>

来源 - Example from the plugin itself.