You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by sudha <su...@gmail.com> on 2012/10/04 00:44:33 UTC

Maven resource plugin

Hi,

I'm trying to use maven resource plugin to copy and filter some property
files from one directory to another ( not src/main/resources ).  The source
directory ( in this case configuration directory under basedir) has just one
property file. When I do a mvn install, it creates the
configuration_filtered directory but also copies a html file present in
src/main/java to configuration_filtered. This should not happen. The html
file should be copied to WEB-INF. Can someone help?, please.


This is my plugin code:

 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                    <executions>
                        <execution>
                            <id>copy-resources-1</id>
                            <phase>package</phase>
                            <goals>
                                <goal>
                                    copy-resources
                                </goal>
                            </goals>
                        </execution>
                       
                    </executions>
                    <configuration>
                       
<outputDirectory>${basedir}/configuration_filtered</outputDirectory>
                        <resources>
                            <resource>
                               
<directory>${basedir}/configuration</directory>
                                <includes>
                                    <include>
                                        **/*.properties
                                    </include>
                                    <include>
                                        **/*.xml
                                    </include>
                                </includes>
                                <excludes>
                                    <exclude>
                                        **/*.html
                                    </exclude>
                                </excludes>
                                <filtering>true</filtering>
                            </resource>
                        </resources>
                        <buildFilters>
                           
<buildFilter>${basedir}/tokenfile.dev</buildFilter>
                        </buildFilters>
                        <useBuildFilters>true</useBuildFilters>
                        <delimiters>
                            <delimiter>${*}</delimiter>
                            <delimiter>@</delimiter>
                        </delimiters>
                        
                    </configuration>
                </plugin>

-Thanks



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-resource-plugin-tp5724796.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven resource plugin

Posted by sudha <su...@gmail.com>.
Thanks. That worked.



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-resource-plugin-tp5724796p5724909.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven resource plugin

Posted by Anders Hammar <an...@hammar.net>.
You need to move the configuration section into the execution you want
it for. The current setup will also affect default lifecycle bindings
of the resources plugin.

/Anders

On Thu, Oct 4, 2012 at 12:44 AM, sudha <su...@gmail.com> wrote:
> Hi,
>
> I'm trying to use maven resource plugin to copy and filter some property
> files from one directory to another ( not src/main/resources ).  The source
> directory ( in this case configuration directory under basedir) has just one
> property file. When I do a mvn install, it creates the
> configuration_filtered directory but also copies a html file present in
> src/main/java to configuration_filtered. This should not happen. The html
> file should be copied to WEB-INF. Can someone help?, please.
>
>
> This is my plugin code:
>
>  <plugin>
>                     <groupId>org.apache.maven.plugins</groupId>
>                     <artifactId>maven-resources-plugin</artifactId>
>                     <version>2.6</version>
>                     <executions>
>                         <execution>
>                             <id>copy-resources-1</id>
>                             <phase>package</phase>
>                             <goals>
>                                 <goal>
>                                     copy-resources
>                                 </goal>
>                             </goals>
>                         </execution>
>
>                     </executions>
>                     <configuration>
>
> <outputDirectory>${basedir}/configuration_filtered</outputDirectory>
>                         <resources>
>                             <resource>
>
> <directory>${basedir}/configuration</directory>
>                                 <includes>
>                                     <include>
>                                         **/*.properties
>                                     </include>
>                                     <include>
>                                         **/*.xml
>                                     </include>
>                                 </includes>
>                                 <excludes>
>                                     <exclude>
>                                         **/*.html
>                                     </exclude>
>                                 </excludes>
>                                 <filtering>true</filtering>
>                             </resource>
>                         </resources>
>                         <buildFilters>
>
> <buildFilter>${basedir}/tokenfile.dev</buildFilter>
>                         </buildFilters>
>                         <useBuildFilters>true</useBuildFilters>
>                         <delimiters>
>                             <delimiter>${*}</delimiter>
>                             <delimiter>@</delimiter>
>                         </delimiters>
>
>                     </configuration>
>                 </plugin>
>
> -Thanks
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-resource-plugin-tp5724796.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org