Using maven-rpm-plugin how do I to replace text in files similar to the assembly plugin -


i have maven project create 2 packagings. 1 tar.gz file (for targets) , rpm linux targets can use rpm. use maven-assembly-plugin tar.gz file. use maven-rpm-plugin rpm packaging.

the assembly plug allows specification of true option replace maven properties in target files. example (from pom):

<fileset>     <directory>${basedir}/src/resources/</directory>     <outputdirectory>/</outputdirectory>     <filtered>true</filtered>     <includes>         <include>**/*.sh</include>     </includes>     <filemode>0774</filemode> </fileset> 

my .sh file has section in declared jar file java command line:

java -cp $argo_home/client/lib/${project.artifactid}-${project.version}.jar 

when use maven assembly plugin defined above, ${project.artifactid}-${project.version} gets translated accordingly.

however, when use same files rpm build these variables not replaced.

is there way can rpm configuration work assembly config? cannot find docs tell me possible. btw rpm config looks this:

         <mapping>           <directory>/opt/argo/client/bin</directory>           <directoryincluded>false</directoryincluded>           <username>argo</username>           <groupname>argogroup</groupname>           <filemode>744</filemode>           <sources>             <source>               <location>src/resources/client/bin</location>               <includes>                 <include>*.sh</include>               </includes>             </source>           </sources>         </mapping> 

what love put true in mapping , call day. there way using maven-rpm-plugin?

i thinking of using maven-replacer-plugin, not elegant i'd like.

any suggestions?

had same issue using postinstallscriptlet configuration, solved following orientation use maven-resources-plugin, seen here: does external script in rpm-maven-plugin have access maven properties

so configuration should be:

for maven-resources-plugin:

<configuration>     <outputdirectory>${basedir}/target/classes/scripts</outputdirectory>     <resources>                   <resource>           <directory>src/resources/client/bin</directory>           <filtering>true</filtering>         </resource>     </resources>               </configuration> 

for rpm-maven-plugin:

    <mapping>       <directory>/opt/argo/client/bin</directory>       <directoryincluded>false</directoryincluded>       <username>argo</username>       <groupname>argogroup</groupname>       <filemode>744</filemode>       <sources>         <source>           <location>${basedir}/target/classes/scripts</location>           <includes>             <include>*.sh</include>           </includes>         </source>       </sources>     </mapping> 

this way maven-resources-plugin filter maven properties copied file, referred on rpm-maven-plugin


Comments