edit-icon download-icon

Configure the EDAS private server address in Maven

Last Updated: Apr 18, 2018

Add private server configuration

Find the Maven configuration files, usually in the file ~/.m2/settings.xml. In settings.xml, add the following configuration:

  1. <profiles>
  2. <profile>
  3. <id>nexus</id>
  4. <repositories>
  5. <repository>
  6. <id>central</id>
  7. <url>http://repo1.maven.org/maven2</url>
  8. <releases>
  9. <enabled>true</enabled>
  10. </releases>
  11. <snapshots>
  12. <enabled>true</enabled>
  13. </snapshots>
  14. </repository>
  15. </repositories>
  16. <pluginRepositories>
  17. <pluginRepository>
  18. <id>central</id>
  19. <url>http://repo1.maven.org/maven2</url>
  20. <releases>
  21. <enabled>true</enabled>
  22. </releases>
  23. <snapshots>
  24. <enabled>true</enabled>
  25. </snapshots>
  26. </pluginRepository>
  27. </pluginRepositories>
  28. </profile>
  29. <profile>
  30. <id>edas.oss.repo</id>
  31. <repositories>
  32. <repository>
  33. <id>edas-oss-central</id>
  34. <name>taobao mirror central</name>
  35. <url>http://edas-public.oss-cn-hangzhou.aliyuncs.com/repository</url>
  36. <snapshots>
  37. <enabled>true</enabled>
  38. </snapshots>
  39. <releases>
  40. <enabled>true</enabled>
  41. </releases>
  42. </repository>
  43. </repositories>
  44. <pluginRepositories>
  45. <pluginRepository>
  46. <id>edas-oss-plugin-central</id>
  47. <url>http://edas-public.oss-cn-hangzhou.aliyuncs.com/repository</url>
  48. <snapshots>
  49. <enabled>true</enabled>
  50. </snapshots>
  51. <releases>
  52. <enabled>true</enabled>
  53. </releases>
  54. </pluginRepository>
  55. </pluginRepositories>
  56. </profile>
  57. </profiles>
  58. <activeProfiles>
  59. <activeProfile>nexus</activeProfile>
  60. <activeProfile>edas.oss.repo</activeProfile>
  61. </activeProfiles>

Download a setting.xml sample file.。

Verify that the configuration has been added successfully.

Run mvn help:effective-settings on the command line.

  1. If no error exists, the file format of setting.xml is correct.
  2. If profiles contains the edas.oss.repo profile, this indicates that the private server has been configured in profiles.
  3. If activeProfiles contains the edas.oss.repo attribute, the private server of edas.oss.repo has been activated.

Note: If the Maven package command can be run on the command line without issue, IDE still cannot download dependencies. Please restart IDE or manually search for the relevant IDE log for Maven configuration.

Thank you! We've received your feedback.