Versiones de compatibilidad
Manipular para compatibilidad de paquetes, jars versionados, etc.
In Fedora we prefer to always have only the latest version of a given project. Unfortunately, this is not always possible as some projects change too much and it would be too hard to port dependent packages to the current version. It is not possible to just update the package and keep the old version around as the names, file paths and dependency provides would clash. The recommended practice is to update the current package to the new version and create new package representing the old version (called compat package). The compat package needs to have the version number (usually only the major number, unless further distinction is necessary) appended to the name, thus effectivelly having different name from RPM’s point of view. Such compat package needs to perform some additional steps to ensure that it can be installed and used along the non-compat one.
|
You should always evaluate whether creating a compat package is really necessary. Porting dependent projects to new versions of dependencies may be a complicated task, but your effort would be appreciated and it is likely that the patch will be accepted upstream at some point in time. If the upstream is already inactive and the package is not required by anything, you should also consider retiring it. |
Versiones de compatibilidad de Maven
XMvn supports marking particular artifact as compat, performing the necessary steps to avoid clashes with the non-compat version. An artifact can be marked as compat by %mvn_compat_version. It accepts an artifact argument which will determine which artifact will be compat. The format for specifying artifact coordinates is the same as with %mvn_alias. In the common case you will want to mark all artifacts as compat. You can specify multiple compat versions at a time.
Cuando XMvn realiza la resolución de dependencias para un artefacto de dependencia en un proyecto, verifica la versión de la dependencia y la compara con todas las versiones del artefacto instaladas en el directorio de compilación. Si ninguno de los artefactos compatibles coincide, resolverá el artefacto al que no sea compatible. Esto tiene algunas implicaciones:
-
The versions are compared for exact match. The compat package should provide all applicable versions that are present in packages that are supposed to be used with this version.
-
The dependent packages need to have correct
BuildRequireson the compat package as the virtual provides is also different (see below).
In order to prevent file name clashes, compat artifacts have the first specified compat version appended to the filename. Virtual provides for compat artifacts also contain the version as the last part of the coordinates. There are multiple provides for each specified compat version. Non-compat artifact do not have any version in the virtual provides.
%mvn_compat_version# Asumiendo el paquete tiene barra de nombre y versión 3
# Conjuntos el compat versión de foo:artefacto de barra a 3
%mvn_compat_versión foo:barra 3
# El archivo de artefacto instalada (suponiendo que es un jar y no había ninguno
# %mvn_llamadas de lima) será en %{_javadir}/barra/de barra-3.Bote
# El generado proporciona para foo:la barra será
# mvn(foo:barra:3) = 3
# mvn(foo:barra:pom:3) = 3
# Establece las versiones de compatibilidad de todos los artefactos en la compilación a 3 y 3.2.
%mvn_compat_version : 3 3.2
Want to help? Learn how to contribute to Fedora Docs ›