Question

One of my group's pom files uses the maven-antrun-plugin to do an rpm build. I don't know why, and we can't change it for now. The pom has version 1.0.0-Sprint2-SNAPSHOT, and during the build, I get

[exec] error: line 2: Illegal char '-' in version: Version: 1.0.0-Sprint2. 

How can I alleviate this? This looks like a valid version to me.

Était-ce utile?

La solution

This error is not coming from maven but rather during the execution of the maven-antrun-plugin, and specifically during the rpm build. RPM does not allow dashes in the version tag. The following quote is taken from their pages.

The version tag defines the version of the software being packaged. The version specified should be as close as possible to the format of the original software's version. In most cases, there should be no problem specifying the version just as the software's original developer did. However, there is a restriction. There can be no dashes in the version. If you forget, RPM will remind you:

# rpm -ba cdplayer-1.0.spec
* Package: cdplayer
Illegal '-' char in version: 1.0-a
#

This is the error you are seeing. To fix it you will need to modify the configuration of the rpm execution.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top