How to deploy core extension

let s say i want to add some functionality into core component, specifically xwiki-platform-oldcore

I managed to make changes, compiled it and get a jar file, but I wonder how to deploy it. Usually it is sufficient to replace existing jar in WEB-INF/lib - but in this case the original jar (xwiki-platform-oldcore-12.9.jar) is not there - it is probably installed as dependency. How do I deploy it?

Note: It’s dangerous to do that. Best to introduce your own extension JAR with components overriding the default ones (see https://extensions.xwiki.org/xwiki/bin/view/Extension/Component%20Module#HOverrides).

Now for oldcore the reason is simple, there are some aspects weaved into it in the legacy oldcore module and that’s the module you see in WEB-INF/lib. So you’ll need to remove this JAR and use your oldcore one (note that your oldcore will not have legacy API since they’re in oldcore, if you need them then you need to build the legacy oldcore module and use that jar).