gemnasium is downloading gemnasium-maven-plugin from maven central at runtime
Summary
When using self-hosted analyzer image for gemnasium, the analyzer errors saying gemnasium-maven-plugin pom file cannot be found. It seems that maven attempts to download the plugin from the remote registry rather than using the local copy.
Steps to reproduce
- Follow the steps in Running dependency scanning in an offline environment
- Run the dependency scanning job.
- Job fails with below error:
[0;34m[DEBU] [gemnasium-maven] [2023-05-16T10:55:24Z] [/go/src/app/builder/maven/maven.go:87] ▶ /opt/asdf/shims/mvn com.gemnasium:gemnasium-maven-plugin:0.4.0:dump-dependencies -s settings.xml -Dmaven.wagon.http.ssl.insecure=true
[INFO] Scanning for projects...
Downloading from gitlab-maven: https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven/sg/gov/ica/ms/framework/common/ips-parent-pom/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading from gitlab-maven: https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven/com/gemnasium/gemnasium-maven-plugin/0.4.0/gemnasium-maven-plugin-0.4.0.pom
[WARNING] The POM for com.gemnasium:gemnasium-maven-plugin:jar:0.4.0 is missing, no dependency information available
Downloading from gitlab-maven: https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven/com/gemnasium/gemnasium-maven-plugin/0.4.0/gemnasium-maven-plugin-0.4.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.814 s
[INFO] Finished at: 2023-05-16T10:55:24Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin com.gemnasium:gemnasium-maven-plugin:0.4.0 or one of its dependencies could not be resolved: Could not find artifact com.gemnasium:gemnasium-maven-plugin:jar:0.4.0 in gitlab-maven (https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[0m
exit status 1
What is the current bug behavior?
com.gemnasium:gemnasium-maven-plugin:jar cannot be found.
What is the expected correct behavior?
Artifact com.gemnasium:gemnasium-maven-plugin:jar should be found.
Relevant logs and/or screenshots
[0;34m[DEBU] [gemnasium-maven] [2023-05-16T10:55:24Z] [/go/src/app/builder/maven/maven.go:87] ▶ /opt/asdf/shims/mvn com.gemnasium:gemnasium-maven-plugin:0.4.0:dump-dependencies -s settings.xml -Dmaven.wagon.http.ssl.insecure=true
[INFO] Scanning for projects...
Downloading from gitlab-maven: https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven/sg/gov/ica/ms/framework/common/ips-parent-pom/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading from gitlab-maven: https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven/com/gemnasium/gemnasium-maven-plugin/0.4.0/gemnasium-maven-plugin-0.4.0.pom
[WARNING] The POM for com.gemnasium:gemnasium-maven-plugin:jar:0.4.0 is missing, no dependency information available
Downloading from gitlab-maven: https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven/com/gemnasium/gemnasium-maven-plugin/0.4.0/gemnasium-maven-plugin-0.4.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.814 s
[INFO] Finished at: 2023-05-16T10:55:24Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin com.gemnasium:gemnasium-maven-plugin:0.4.0 or one of its dependencies could not be resolved: Could not find artifact com.gemnasium:gemnasium-maven-plugin:jar:0.4.0 in gitlab-maven (https://<GitlabDomainName>/api/v4/groups/103/-/packages/maven) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[0m
exit status 1
Output of checks
GitLab version: 15.9.1
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.7.7p221 Gem Version: 3.1.6 Bundler Version:2.3.15 Rake Version: 13.0.6 Redis Version: 6.2.8 Sidekiq Version:6.5.7 Go Version: unknown GitLab information Version: 15.9.1-ee Revision: 2ed52f97df8 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 13.8 URL: https:// HTTP Clone URL: https:///some-group/some-project.git SSH Clone URL: git@:some-group/some-project.git Elasticsearch: no Geo: yes Geo node: Primary Using LDAP: yes Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 14.17.0 Repository storages: - default: unix:/var/opt/gitlab/gitaly/gitaly.socket GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 14.17.0 ? ... OK (14.17.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/2
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... Server: ldapmain not verifying SSL hostname of LDAPS server ':636' LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 100 users of 100 limit.
Checking LDAP ... Finished
Checking GitLab App ...
Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 2/2 ... yes 9/3 ... yes 14/5 ... yes 18/8 ... yes 18/9 ... yes 18/12 ... yes 18/14 ... yes 9/16 ... yes 9/18 ... yes 37/19 ... yes 37/20 ... yes 37/21 ... yes 37/22 ... yes 37/23 ... yes 49/24 ... yes 49/25 ... yes 18/28 ... yes 59/31 ... yes 103/65 ... yes 103/98 ... yes 103/99 ... yes 104/100 ... yes 18/101 ... yes 18/102 ... yes 18/103 ... yes 18/104 ... yes 18/105 ... yes 18/106 ... yes 18/107 ... yes 18/108 ... yes 104/109 ... yes 101/110 ... yes 18/111 ... yes 101/112 ... yes 101/114 ... yes 101/115 ... yes 142/116 ... yes 142/118 ... yes 142/119 ... yes 101/120 ... yes 103/122 ... yes 103/125 ... yes 178/127 ... yes 101/128 ... yes 101/129 ... yes 101/130 ... yes 101/131 ... yes 101/132 ... yes 101/133 ... yes 101/134 ... yes 101/135 ... yes 9/136 ... yes 101/138 ... yes 103/140 ... yes 104/141 ... yes 104/142 ... yes 101/143 ... yes 101/144 ... yes 104/145 ... yes 101/146 ... yes 103/147 ... yes 103/148 ... yes 103/149 ... yes 101/151 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.7) Git user has default SSH configuration? ... yes Active users: ... 20 Is authorized keys file accessible? ... skipped (authorized keys not enabled) GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 7.x-8.x or OpenSearch version 1.x ... skipped (Advanced Search is disabled) All migrations must be finished before doing a major upgrade ... skipped (Advanced Search is disabled)
Checking GitLab App ... Finished
Checking Geo ...
GitLab Geo is available ... GitLab Geo is enabled ... yes This machine's Geo node name matches a database record ... yes, found a primary node named "ldcprimary" HTTP/HTTPS repository cloning is enabled ... yes Machine clock is synchronized ... yes Git user has default SSH configuration? ... yes OpenSSH configured to use AuthorizedKeysCommand ... skipped Reason: Cannot access OpenSSH configuration file Try fixing it: This is expected if you are using SELinux. You may want to check configuration manually For more information see: doc/administration/operations/fast_ssh_key_lookup.md GitLab configured to disable writing to authorized_keys file ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes
Checking Geo ... Finished
Checking GitLab subtasks ... Finished