Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven-resources-plugin won't copy .metadata folder

I'm trying to copy a folder or following structure with maven-resources-plugin:

  root
   |- .metadata
   |- Project
   \- .gitignore

Project directory and .gitignore files are copied, but .metadata directory is left out for some reason.

How do I copy all contents of root folder?

Here is configuration I tried:

  <plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.5</version>
    <executions>
      <execution>
        <id>copy-resources</id>
        <phase>validate</phase>
        <goals>
          <goal>copy-resources</goal>
        </goals>
        <configuration>
          <outputDirectory>${project.build.directory}/aut-ws</outputDirectory>
          <useBuildFilters>false</useBuildFilters>
          <nonFilteredFileExtensions>
            <nonFilteredFileExtension>metadata</nonFilteredFileExtension>
          </nonFilteredFileExtensions>
          <resources>
            <resource>
              <directory>H:\rcptt\workspaces\root</directory>
            </resource>
          </resources>
        </configuration>
      </execution>
    </executions>
  </plugin>
like image 418
Basilevs Avatar asked Feb 13 '23 05:02

Basilevs


1 Answers

You're looking for the configuration parameter addDefaultExcludes. See the documentation page.

So your configuration section should look like the following:

    <configuration>
      <outputDirectory>${project.build.directory}/aut-ws</outputDirectory>
      <addDefaultExcludes>false</addDefaultExcludes>
      ...
      <resources>
        <resource>
          <directory>H:\rcptt\workspaces\root</directory>
        </resource>
      </resources>
    </configuration>
like image 121
Elie Richa Avatar answered Feb 15 '23 12:02

Elie Richa