This is not standard practice and is likely to cause issues. Normally any dependencies you need should be published either to Jenkins Artifactory, if they are specific to Jenkins, or Maven Central if not.
If you really want to access GH Packages, you can probably do so with `GITHUB_TOKEN` in GHA without needing a PAT. This would work for the CD action, probably with custom modifications, but would not work for
ci.jenkins.io so Jenkinsfile would be useless; you would need to set up your own CI.