Issue
We have set up a jfrog repository for RPM files. We are building RPM using 'rpm-maven-plugin' and were trying to upload the rpm file into jfrog repository.
We have tried using CMD- jfrog rt u "(*.rpm)" service/ --recursive=false --props=rpm.metadata.version=test
We have also updated in maven settings.xml and deploymentRepo tag in maven for jfrog repo but still failing.
We were successfully deploying the RPM in YUM repository and checksum updated in repodata as well but not working with JFROG.
Maven RPM plugin configuration:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-rpm</id>
<phase>install</phase>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<needarch>noarch</needarch>
<targetOS>linux</targetOS>
<name>${artifact_name}</name>
<version>${rpm_version}</version>
<license>${name}</license>
<group>default</group>
<release>${rpm_release}</release>
<keyname />
<repackJars>false</repackJars>
<copyTo>${directory}/${artifact_name}${version}${release}.noarch.rpm</copyTo>
<requires>
<require>jre8 >= 1.8</require>
</requires>
<repackJars>false</repackJars>
<defineStatements>
<defineStatement>_build_sign DSA</defineStatement>
<defineStatement>_source_filedigest_algorithm md5</defineStatement>
<defineStatement>_binary_filedigest_algorithm md5</defineStatement>
<defineStatement>_source_payload w0.gzdio</defineStatement>
<defineStatement>_binary_payload w0.gzdio</defineStatement>
<defineStatement>__os_install_post %{nil}</defineStatement>
</defineStatements>
<preinstallScriptlet>
<scriptFile>${directory}/scripts/preinstall.sh</scriptFile>
</preinstallScriptlet>
<postinstallScriptlet>
<scriptFile>${directory}/scripts/postinstall.sh</scriptFile>
</postinstallScriptlet>
<preremoveScriptlet>
<scriptFile>${directory}/scripts/preremove.sh</scriptFile>
</preremoveScriptlet>
<postremoveScriptlet>
<scriptFile>${directory}/scripts/postremove.sh</scriptFile>
</postremoveScriptlet>
<defaultFilemode>644</defaultFilemode>
<defaultDirmode>711</defaultDirmode>
<defaultUsername>${user}</defaultUsername>
<defaultGroupname>${groupname}</defaultGroupname>
<mappings>
<mapping>
<directory>${dir_path}</directory>
<sources>
<source>
<location>${basedir}/../target/service-test.jar</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</plugin>
While uploading we are getting below error. [Error] [Thread 2] Artifactory response: 403 Forbidden
{
"errors": [
{ "status": 404, "message": "Checksum deploy failed. No existing file with SHA-1: abc" }
]
}
[Error] Failed uploading 1 artifacts.
{
"status": "failure",
"totals":
{ "success": 0, "failure": 1 }
}
We were able to successfully upload the same RPM file using JFROG GUI.
Solution
I have solved the issues. Now we are creating maven artifacts using checksum(SHA) plugin and get deployed in jfrog.
<groupId>net.ju-n.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
Answered By - Ritesh Answer Checked By - Clifford M. (WPSolving Volunteer)