RPM package after generate a jar file with the same pom.xml

24 Views Asked by At

Create a RPM package after generate a jar file with the same pom.xml I’m using the plugin org.codehaus.mojo. I would like to create a RPM package after create a jar file with the same pom.xml file. The documentation is not accurate enought to configure the pom.xml file or the plugin does not work. The plugin find some problems with the directories in order to copy the jar file and to prepare the package. One of most common error is “Unable to copy files for packaging: The destination directory cannot include itself”. It seems than them the prefix item doesn’t work or there are some items misconfigured.

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>rpm-maven-plugin</artifactId>
            <version>2.3.0</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <id>generate-rpm</id>
                    <goals>
                        <goal>rpm</goal>
                    </goals>
                    <!--phase>package</phase>-->
                </execution>
            </executions>
            <configuration>
                <name>${project.artifactId}</name>
                <license>Prop License (c), Me</license>
                <distribution>Test 1.0</distribution>
                <group>${project.basedir}/temp</group>
                <packager>Me</packager>
                <prefix>/usr/local/games</prefix>
                <mappings>
                <mapping>
                    <directory>/usr/local</directory>
                    <!--directoryIncluded>false</directoryIncluded>-->
                    <!--configuration>true</configuration>-->
                    <filemode>777</filemode>
                    <username>rodriguez</username>
                    <groupname>root</groupname>
                    <sources>
                        <source>
                            <!--location>${project.basedir}/target${project.artifactId}-${project.version}.jar</location-->
                            <!--location>${project.basedir}/target/${project.artifactId}.jar</location>-->
                            <location>${project.basedir}/target</location>
                        </source>
                    </sources>
                </mapping>
                </mappings>
                <preinstallScriptlet>
                    <scriptFile>${project.basedir}/scripts/preinstall.sh</scriptFile>
                </preinstallScriptlet>
               <postinstallScriptlet>
                    <scriptFile>${project.basedir}/scripts/postinstall.sh</scriptFile>
                    <fileEncoding>utf-8</fileEncoding>
               </postinstallScriptlet>
            </configuration>
    </plugin>
0

There are 0 best solutions below