2

I have this set, and everything working fine on a Windows box during tests, Deployment to unix box for testing, the folder is missing and is not created :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-resources-plugin</artifactId>
  <version>2.3</version>
  <configuration>
    <includeEmptyDirs>true</includeEmptyDirs>
    <!-- specify UTF-8, ISO-8859-1 or any other file encoding -->
    <encoding>UTF-8</encoding>
  </configuration>
</plugin>

Its location is conventional here:

src/main/resources/myfolder

It's deployed as a war, and the directory is not created in WEB-INF/classes.

The rest of my pom looks like this:

<build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/resources/myfolder</directory>
            </resource>
            <resource>
                <directory>src/main/webapp/WEB-INF</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
shylynx
  • 597
  • 1
  • 7
  • 25
NimChimpsky
  • 46,453
  • 60
  • 198
  • 311
  • 1
    What do you mean by deploy : war:war / jar:jar. Assuming that, do you mean that your resources are not present in classpath (folders for jar or WEB-INF/classes for war? ) – Jean-Rémy Revy Dec 17 '13 at 12:45
  • Do you get some error message? – Angelo Fuchs Dec 17 '13 at 12:46
  • no error except the test that depends on access to that folder can't find it, deployed as war on glassfish – NimChimpsky Dec 17 '13 at 12:47
  • it looks everything normal, you can try – Jaiwo99 Dec 17 '13 at 12:59
  • In your output there should be a line `Copying resources` or similar. Is it there on windows? If yes, have a look at where it should be on linux and copy the relevant part of the output into the question, with a marking on where the code appears in windows. – Angelo Fuchs Dec 17 '13 at 13:07
  • (Also: Is the folder empty? Could it be that the folder gets copied but later removed due to it being empty?) – Angelo Fuchs Dec 17 '13 at 13:09
  • Have you tried without the resources plugin? Maven is supposed to copy everything from the resources directory into your artefact by default anyway, isn't it? – Zoltán Dec 17 '13 at 13:27
  • @Zoltán, it's the resources plugin that performs the copy. OP is adding additional configuration to the plugin to include empty directories and set the encoding. Angelo's suggestion is a good one, you may need to use debug logging (-X) to see the details. If you compare the maven-resource-plugin configuration and executions between the two systems that will probably give a good clue. – user944849 Dec 17 '13 at 17:56

0 Answers0