Reputation: 1447
I am in charge of installing an Artifactory instance in a large corporate environment where Internet access isn't an option. All Maven builds must fetch dependencies from an internal (intranet) Maven repository. A mirror was added to the settings.xml file, and is set to be the default mirror for everything.
I have then setup a standalone computer wired to the Internet to download all necessary dependencies (spring, struts2, etc.) that are endorsed to be used in the different projects across the organization. I created a dummy maven project using mvn archetype:generate in order to populate my local repository with all necessary stuffs for Maven to work as expected.
Installing Artifactory went well, and so was the import of specific dependencies like Spring and Struts2. However, running mvn archetype:generate returned some errors like this:
The POM for org.apache.maven.plugins:maven-install-plugin:jar:2.4 is missing, no dependency information available.
Thus, I realized I needed to import Maven plugins to the Artifactory instance as well, which I did. In fact, I have zipped the entire C:\Users\MYUSER.m2\repository folder on the standalone computer, carried the zip over to the Artifactory server, and then used the Artifactory admin account to import everything using Admin > Import & Export > Repositories > Import Repository from Zip.
Artifactory says that the import completed successfully, but I still get the same error complaining that some Maven plugins are missing. Looking at the artifact page in Artifactory, I see that it's missing some Maven plugins artifacts that were part of the zip. Artifactory did not import everything from my zip file.
org/apache/maven/plugins
Imported in Artifactory under org/apache/maven/plugins
So my question is, why is Artifactory silently omitting to import some dependencies without letting me know about it?
Thank you
UPDATE
Even when I browse for the Maven plugins from the standalone computer under org/apache/maven/plugins (Admin > Import & Export > Repositories > Import Repository from Path), Artifactory won't even show them to me. It will only display the ones that I have listed above.
UPDATE 2017-08-23
artifactory.log
2017-08-23 08:18:13,100 [art-exec-1] [INFO ] (o.a.r.d.i.DbRepoImportHandler:149) - repo-endorsed import started C:\dev\repository
2017-08-23 08:18:40,468 [art-exec-1] [INFO ] (o.a.r.d.i.ImportExportAccumulator:98) - repo-endorsed imported 1000 items (574 files 426 folders 36.58 ips) 0 skipped items (0 files 0 folders)...
2017-08-23 08:19:06,906 [art-exec-1] [INFO ] (o.a.r.d.i.ImportExportAccumulator:98) - repo-endorsed imported 2000 items (1129 files 871 folders 37.18 ips) 0 skipped items (0 files 0 folders)...
2017-08-23 08:19:15,829 [art-exec-1] [INFO ] (o.a.r.d.i.DbRepoImportHandler:199) - repo-endorsed import finished with: 2264 Items imported: (1262 files 1002 folders). Duration: 1.04 minutes IPS: 36.14 Target: 'C:\dev\repository'
2017-08-23 08:19:15,829 [art-exec-3] [INFO ] (o.a.r.s.ImportJob :127) - Import of 1 repositories completed
import.export.log
I see several messages like this one, but the artifact is getting imported as expected:
2017-08-23 08:18:36,655 [DEBUG] (o.a.a.c.ImportExportStatusHolder:43) No Metadata entries found for C:\dev\repository\org\apache\maven\plugins\maven-compiler-plugin\3.1\maven-compiler-plugin-3.1.jar
Looking at those messages, I don't see anything related to missing parts like maven-install-plugin. Looks like Artifactory literally skipped it.
Upvotes: 3
Views: 2174
Reputation: 3506
Thanks for adding the additional information. Just to make sure, when you are going to:
C:\dev\repository\org\apache\maven\plugins\maven-compiler-plugin\3.1
can you see the maven-compiler-plugin-3.1.pom file?
If Artifactory doesn't have the pom file it will not generate the maven-metadata file on the folder level, meaning that the maven client won't get it as a result when you run a maven build.
To overcome this issue, if this is indeed a missing POM, you can manually deploy this JAR file to that location via the UI and use the "auto generate POM" feature which will create a POM file to that JAR, resulting with maven-metadata calculation.
Upvotes: 1