I have install folder in apps/project/install and it has core Jar file. But when I do mvn clean install -PautoInstallPackage then core jar is not updating. It's only working at the first build.
Also when I replicating ui.apps then I can see install folder and bundle in system/console(in active state) but pages is not fetching bundle classes. Getting Below error
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/myproj/components/content/categoryButtons/
So I have again need to deploy in publish instance via cmd
This is a weird scenario. It shouldn't be behaving like this. I reviewed your pom.xml for ui.apps, and parent pom, and it looks okay. the SNAPSHOT exists; SNAPSHOTS ensures that when new packages are uploaded into AEM, it will allow the content packages + jar files to be overwritten, whereas without the SNAPSHOT label, you are forced to increment the version of the bundle version.
If this is still not working, I'm suggesting that you try to build your code into a new fresh AEM instance, and test out the installation from there.
"when I do mvn clean install -PautoInstallPackage then core jar is not updating" - Is it like the bundle is not reflecting your latest changes each time ? Just make sure that every-time you install your package to any ENV , there should be a version upgrade else sometimes you might not see your updated changes in the bundle