On 2011-03-11 15:54, EVL wrote:
> Hi all,
> 
> 
> I am trying to filter some resource files and when I run mvn with verbosity
> looks like the filter is being executed, but when I open the destination
> files the ${var} reference are still there instead of the value. 
> 
> My configuration follows:
> 
> ...
> 
> <build>
> 
>       <resources>
> 
>               <resource>
> 
>                       
> <directory>fs_module/src/main/resources</directory>
> 
>                       <includes>
> 
>                               <include>**/*.xml</include>
> 
>                               <include>**/*.properties</include>
> 
>                               <include>**/*.csv</include>
> 
>                       </includes>
> 
>                       <filtering>true</filtering>
> 
>               </resource>
> 
>       </resources>
> 
> ...
> 
>       <profiles>
> 
>               <profile>
> 
>                       <id>development</id>
> 
>                       <activation>
> 
>                               <property>
> 
>                                       
> <name>environment.type</name>
> 
>                                       <value>dev</value>
> 
>                               </property>
> 
>                       </activation>
> 
>                       <properties>
> 
>                       
> <project.build.filters>filter.dev.properties</project.build.filters>
> 
>                       </properties>
> 
>               </profile>
> 
> ...
> 
> 
> 
> If I check the profile activation, the dev profile is active on all modules,
> and when executing mvn resources:resources it echoes:
> 
> 
> ...
> 
> [DEBUG] Configuring mojo
> 'org.apache.maven.plugins:maven-resources-plugin:2.5:re
> sources' with basic configurator -->
> [DEBUG]   (f) buildFilters = []
> [DEBUG]   (f) encoding = UTF-8
> [DEBUG]   (f) escapeWindowsPaths = true
> [DEBUG]   (s) includeEmptyDirs = false
> [DEBUG]   (s) outputDirectory = C:\workspace\ECBench\target\
> classes
> [DEBUG]   (s) overwrite = false
> [DEBUG]   (f) project = MavenProject:
> com.unic.ecbench:ecbench-all:1.0-SNAPSHOT
> @ C:\workspace\ECBench\pom.xml
> [DEBUG]   (s) resources = [Resource {targetPath: null, filtering: true,
> FileSet
> {directory: C:\workspace\ECBench\fs_module\src\main\resource
> s, PatternSet [includes: {**/*.xml, **/*.properties, **/*.csv}, excludes:
> {}]}}]
> 
> [DEBUG]   (f) session = org.apache.maven.execution.MavenSession@2b249
> [DEBUG]   (f) supportMultiLineFiltering = false
> [DEBUG]   (f) useBuildFilters = true
> [DEBUG]   (s) useDefaultDelimiters = true
> [DEBUG] -- end configuration --
> ...
> [DEBUG] resource with targetPath null
> directory C:\workspace\ECBench\fs_module\src\main\resources
> excludes []
> includes [**/*.xml, **/*.properties, **/*.csv]
> [DEBUG] ignoreDelta true
> [INFO] Copying 10 resources
> ...
> [DEBUG] file persistence.xml has a filtered file extension
> [DEBUG] filtering
> C:\workspace\ECBench\fs_module\src\main\resources\META-INF\persistence.xml
> to C:\workspace\ECBench\target\classes\META-INF\persistence.xml
> ...
> 
> 
> 
> persistece.xml is the file to be filtered, and filter.dev.properties
> contains the declaration of the property, indeed.
> 
> pom.xml is on the root of my project and filter.dev.properties in on the
> root as well.

The property you are using is most likely clashing with the POM. It is
unwise to use a property named "project.build.filters" because that is
sometimes how the content of the <project>/<build>/<filters> element is
referred. Try renaming it to "myFilter" so there is no risk of confusion
and try again.

> For some reason the properties file is not being recognized, as the echo
> [DEBUG]   (f) buildFilters = [] should contain the reference to this file
> and does not.
> 
> Any ideas about what can be wrong or where can I take a look, please?
> 
> Thank you in advance.
> 
> 
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/Filter-executed-but-values-not-substituted-tp3425193p3425193.html
> Sent from the Maven - Users mailing list archive at Nabble.com.


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to