1

I've got the maven-enunciate-plugin integrated so that it generates documentation during the build and outputs it to the docs directory under the target directory. As I'm new to Maven I would like to know what would be the ideal way to configure my build so that it packages the docs directory into the WAR artifact of my build. Currently it is left outside of the WAR. Thanks, Mike

Mike
  • 401
  • 1
  • 6
  • 15

1 Answers1

0

Please take a look at this and this

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <!--
            Exclude JCL and LOG4J since all logging should go through SLF4J.
            Note that we're excluding log4j-<version>.jar but keeping
            log4j-over-slf4j-<version>.jar
          -->
          <packagingExcludes>
            WEB-INF/lib/commons-logging-*.jar,
            %regex[WEB-INF/lib/log4j-(?!over-slf4j).*.jar]
          </packagingExcludes>                               
          <packagingIncludes>
            **/docs
          </packagingIncludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...
</project>
Community
  • 1
  • 1
Shmil The Cat
  • 4,548
  • 2
  • 28
  • 37
  • This seems like a good direction with the only problem being that I would like the docs directory to be copied to the root folder i.e. alongside WEB-INF and not inside the classes directory. For this purpose it appears that I can use the ${project.build.directory}/docs configuration. This does the trick however the docs directory contents are copied alongside WEB-INF without the docs directory itself. It would be very helpful if there was a configuration allowing copying the directory itself as well. – Mike Mar 13 '13 at 16:41
  • @Mike for this end, you can specify the see http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html (the paragraph on "Overriding the default destination directory") ${project.build.directory}/docs – Shmil The Cat Mar 13 '13 at 17:02