Maven filtering test resources

When running tests in maven it's common usage to have configuration files that should be filtered.

When filtering "normal" resources the syntax is the following :

filtering resources
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!--xml version="1.0" encoding="UTF-8"?-->
 
...
 
  <build>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
 
     </resources>     
...
</build>
</project>

Whereas when filtering test resources the syntax is following :

filtering test resources
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!--xml version="1.0" encoding="UTF-8"?-->
 
 ...
 
  <build>
      <testresources>
          <testresource>
              <directory>${project.basedir}/src/test/resources</directory>
              <filtering>true</filtering>
          </testresource>
      </testresources>
  ...
  </build>
</project>

Otherwise your test resources will not be filtered

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Some mistakes (typo) in the tags :

    In place of 'testresources' you should write 'testResources'
    In place of 'testresource' you should write 'testResource'

    Thanks !

    ReplyDelete

OSX show used ports or listening applications with their PID

On OSX you can display applications listening on a given port using the lsof the commands described below will show listening application...