maven rpm plugin with multiple mappings

1.7k views Asked by At

I am building an rpm package that includes a 3PP software plus other configuration files. When I don't include the configuration files, the rpm builds properly but when I include the configuration files, the rpm build but installation of the 3PP software in the lab fails. Here is a snapshot of my pom.xml:

 <properties>
    <rpm-root>/opt</rpm-root>
    <comp-name>mycompany</comp-name>
    <install-path>mgmt</install-path>
</properties>
<build>
  <plugins>
    <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>rpm-maven-plugin</artifactId>
     <configuration>
          <mappings>
            <mapping>
               <directory>${rpm-root}</directory>
               <configuration>true</configuration>
               <sources>
                   <source>
                      <location>src/main/binary</location>
                   </source>
               </sources>
            </mapping>
            <mapping>
              <directory>${rpm-root}/${comp-name}/${install-path}/config</directory>
              <directoryIncluded>false</directoryIncluded>
              <configuration>true</configuration>
              <sources>
                  <source>
                     <location>src/main/config</location>
                  </source>
              </sources>
           </mapping>
     </mappings>
   </configuration>
 </plugin>

in src/main/binary this is what I have: ls -ltr src/main//binary/opendj

opendj is the 3PP software I am packaing.

With the above pom.xml this is what I get:

/opt/mycompany/mgmt/config/mgmt.properties
/opt/opendj/Legal/license_to_accept.txt
/opt/opendj/QuickSetup.app/Contents/Info.plist

and in this case the installation of the 3PP (opendj) fails

If I don't include the configuration files in the rpm plugin, this is what I get:

**/opt
/opt/opendj**
/opt/opendj/Legal
/opt/opendj/Legal/license_to_accept.txt
/opt/opendj/QuickSetup.app
/opt/opendj/QuickSetup.app/Contents
/opt/opendj/QuickSetup.app/Contents/Info.plist

You can see that in this case, the package creates the directories /opt and /opt/opednj etc.. In this case the installation of the 3PP (opendj) succeeds.

Thanks!

0

There are 0 answers