Revapi-maven how replace platform-oldcore usages

Hello.

I’m upgrading my XWiki extension (an OAUth authenticator extending XWikiAuthServiceImpl) from 10.11.9 to 12.10.3

But when I replace the parent-platform version by 12.10.3 and that I run mvn clean install I got a lot of revapi-maven-plugin error. Is platform-oldcore deprecated by the plugin ? How to replace it or how to satisfy the revapi requirement and solving theses kinds of error ?

For the moment I skip the plugin using xwiki.revapi.skip but it’s not really a solution

Thanks

   [INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  32.501 s
[INFO] Finished at: 2021-01-24T00:12:38+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.revapi:revapi-maven-plugin:0.11.5:check (revapi-check) on project xwiki-ext-authenticator-keycloak: The following API problems caused the build to fail:
[ERROR] java.method.removed: method java.util.List<java.lang.String> com.xpn.xwiki.api.Document::getTranslationList() throws com.xpn.xwiki.XWikiException: Method was removed. [org.xwiki.platform:xwiki-platform-oldcore:jar:10.11]
[ERROR] java.method.removed: method void com.xpn.xwiki.api.Document::rename(java.lang.String) throws com.xpn.xwiki.XWikiException: Method was removed. [org.xwiki.platform:xwiki-platform-oldcore:jar:10.11]
[ERROR] java.method.removed: method void com.xpn.xwiki.doc.XWikiDocument::rename(java.lang.String, java.util.List<java.lang.String>, com.xpn.xwiki.XWikiContext) throws com.xpn.xwiki.XWikiException: Method was removed. [org.xwiki.platform:xwiki-platform-oldcore:jar:10.11]
[ERROR] java.method.removed: method void com.xpn.xwiki.doc.XWikiDocument::rename(java.lang.String, java.util.List<java.lang.String>, java.util.List<java.lang.String>, com.xpn.xwiki.XWikiContext) throws com.xpn.xwiki.XWikiException: Method was removed. [org.xwiki.platform:xwiki-platform-oldcore:jar:10.11]
[ERROR] java.method.removed: method void com.xpn.xwiki.doc.XWikiDocument::rename(java.lang.String, com.xpn.xwiki.XWikiContext) throws com.xpn.xwiki.XWikiException: Method was removed. [org.xwiki.platform:xwiki-platform-oldcore:jar:10.11]
[ERROR] java.class.defaultSerializationChanged: class com.xpn.xwiki.doc.XWikiLink: The default serialization ID for the class has changed. This means that the new version of the class is not deserializable from the byte stream of a serialized old class. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.field.visibilityReduced: field com.xpn.xwiki.objects.BaseElement<R extends org.xwiki.model.reference.EntityReference>.LOGGER: Visibility was reduced from 'protected' to 'private'. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.field.serialVersionUIDChanged: field com.xpn.xwiki.objects.BaseElement<R extends org.xwiki.model.reference.EntityReference>.serialVersionUID: serialVersionUID constant changed. Objects serialized using the old version of the class will no longer be deserializable. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.field.serialVersionUIDChanged: field com.xpn.xwiki.objects.BaseObject.serialVersionUID: serialVersionUID constant changed. Objects serialized using the old version of the class will no longer be deserializable. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.field.serialVersionUIDChanged: field com.xpn.xwiki.objects.BaseProperty<R extends org.xwiki.model.reference.EntityReference>.serialVersionUID: serialVersionUID constant changed. Objects serialized using the old version of the class will no longer be deserializable. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.field.visibilityReduced: field com.xpn.xwiki.objects.classes.BaseClass.LOGGER: Visibility was reduced from 'protected' to 'private'. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.method.parameterTypeChanged: parameter java.util.List com.xpn.xwiki.store.XWikiHibernateStore::search(===org.hibernate.query.Query===, int, int, com.xpn.xwiki.XWikiContext) throws com.xpn.xwiki.XWikiException: The type of the parameter changed from 'org.hibernate.Query' to 'org.hibernate.query.Query'. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.method.addedToInterface: method int com.xpn.xwiki.store.XWikiStoreInterface::getLimitSize(com.xpn.xwiki.XWikiContext, java.lang.Class<?>, java.lang.String): Method was added to an interface. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.method.addedToInterface: method java.net.URL com.xpn.xwiki.web.XWikiURLFactory::createResourceURL(java.lang.String, boolean, com.xpn.xwiki.XWikiContext, java.util.Map<java.lang.String, java.lang.Object>): Method was added to an interface. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.method.addedToInterface: method java.net.URL com.xpn.xwiki.web.XWikiURLFactory::createSkinURL(java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext, java.util.Map<java.lang.String, java.lang.Object>): Method was added to an interface. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.method.addedToInterface: method java.net.URL com.xpn.xwiki.web.XWikiURLFactory::createSkinURL(java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext, java.util.Map<java.lang.String, java.lang.Object>): Method was added to an interface. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]
[ERROR] java.method.addedToInterface: method java.net.URL com.xpn.xwiki.web.XWikiURLFactory::createSkinURL(java.lang.String, java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext, java.util.Map<java.lang.String, java.lang.Object>): Method was added to an interface. [org.xwiki.platform:xwiki-platform-oldcore:jar:12.10]

This is not about oldcore being deprecated but about API you are exposing in your extensions and which have been “broken” (some method removed, etc.). Those errors suggest that you are exposing publicly (as in not in a *.internal.* package) Document, XWikiDocument, XWikiLink, BaseElement, etc. through some of your classes/interfaces (it’s not something XWikiAuthServiceImpl exposes so it does not seems to come from the authenticator class). Is this intended ? If not I would suggest you to move everything which is not meant to be public in an internal package so that revapi ignores it.

Side note: I think it’s possible to use an Oauth2 provider with https://extensions.xwiki.org/xwiki/bin/view/Extension/OpenID%20Connect/OpenID%20Connect%20Authenticator/ but maybe you have a more complex need.

Ha ok thanks ! I do not really understand why this was not trigger with 10.11.9 I did not use internal even.

FI internal seems not suffisent, I had com.xwiki.authenticator and com.xwiki.authenticator.internal doesn’t works I have to use org.xwiki instead. My package name was probably really old.

Thank you !

Because there was no API breakage between your previous version and the version before it. What revapi compare is the API exposed by your API now and what it was exposing in the previously released version.

It should be. Are you sure you are getting the exact same errors and not different ones ? Revapi should now complain that you removed some classes that used to be public (because you moved them). This is expected, and you can fix that by ignoring those this time and remove the ignores after your next release.