Cécile R.
Cécile R.

Reputation: 11

maven rpm plugin .rpmnew / .rpmsave not created

We are using maven-rpm-plugin 2.1 to generate 2 rpms.
In the first rpm we use the option to precise that the file must not be replaced (noreplace) or to precise that the original file must saved (true). Seed the pom extract below.
The rpm is generated and when we install it with rpm -Uvh on a server with an older version, we have no error.

But when we look at the configuration files, they don't have been replaced but no .rpmnew or .rpmsaved have been created.
I don't understand why. (We deploy on a RedHat 6.5).

pom.xml extract :

        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>rpm-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-rpm-generic</id>
                            <goals>
                                <goal>attached-rpm</goal>
                            </goals>
                            <configuration>
                                <group>*****</group>
                                <copyright>2014 - ****</copyright>
                                <vendor>*****</vendor>
                                <packager>***</packager>
                                <name>hovis-conf-generic-rpm</name>
                                <classifier>generic</classifier>
                                <mappings>
                                    <mapping>
                                        <directory>/etc/ssl/certs</directory>
                                        <configuration>true</configuration>
                                        <username>root</username>
                                        <groupname>root</groupname>
                                        <filemode>644</filemode>
                                        <sources>
                                            <source>
                                                <location>*****</location>
                                            </source>
                                        </sources>
                                    </mapping>                                  
                                    <mapping>
                                    <mapping>
                                        <directory>/opt/****/current/conf</directory>
                                        <configuration>noreplace</configuration>
                                        <filemode>755</filemode>
                                        <username>tomcat</username>
                                        <groupname>tomcat</groupname>
                                        <sources>
                                            <source>
                                                <location>***</location>
                                            </source>
                                            <source>
                                                <location>****</location>
                                            </source>
                                    </mapping>
                                </mappings>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>

Last information, we hase snapshot versions for installation test.

Upvotes: 0

Views: 873

Answers (1)

C&#233;cile R.
C&#233;cile R.

Reputation: 11

I have found the problem : we weren't testing the right cases :

The .rpmnew is generated only if the current deployed file has been deployed since the last install AND if the new file to install is different from both the last install and the current file.

The .rpmsav or .rpmori is generated only in the case of a new file in the rpm and a file with the same name already exists (generated manually).

This page explains clearly all the cases : RPM.org Upgrade

Upvotes: 1

Related Questions