Home > Build-Management, Software Engineering > Copy a directory with Maven Resources Plugin

Copy a directory with Maven Resources Plugin

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>com.test</groupId>
	<artifactId>copy-resources</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.basedir}\outputdir</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}\inputdir</directory>
									<filtering>false</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
mvn validate

The Plugin has an optional parameter “includeEmptyDirs” with a default value “false”. Add the parameter to the plugin configuration to copy any empty directories included in the Resources.

...
<includeEmptyDirs>true</includeEmptyDirs>
...

For more informations have a look at the docu here.

Advertisements
  1. May 24, 2013 at 01:27

    obviously like your website however you have to take
    a look at the spelling on quite a few of your posts. Many
    of them are rife with spelling problems and I to find it very troublesome to tell the truth then
    again I’ll certainly come again again.

    • May 24, 2013 at 10:14

      Hi,

      if you have any tips for me, I will be happy to improve the spelling. I’m no native English speaker. So sometimes it’s hard for me to find the correct spelling.

      Kind regards
      Chris

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s