Maven plugin: copy a file content into another file -


i looking appropriate plugin copy file content file.

my resource.xml has content this:

<class>my.path.resourcea</class> <class>my.path.resourceb</class> <class>my.path.resourcec</class> 

and must copied destination.xml @ place of ${content}:

<aaa>some info</aaa> ${content} 

what proper maven plugin task, please? thank in advance. nic

in general maven, must first thinkg want do. might seem weird @ first sight, maven opinionated build tool, not simple weird/workaround things ;-).

here, need 2 things:

  1. load file "content" property (before resource filtering starts binding phase, obviously, see next point)
  2. just activate resource filtering , done

unfortunately, there's no well-known/standard plugin (1) able load file inside property.

a possible way, before rewriting through dedicated plugin or so, using antrun-maven-plugin (through loadfile task?) or gmaven plugin load file property (during initialize phase, example, happens before process-resources, see documentation lifecycle.)

then, (2), have activate filtering (see standard documentation of maven-resources-plugin).


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

tsql - Pivot with Temp Table (definition for column must include data type) -- SQL Server 2008 -