#配置阿里镜像 root@dify:/opt/maven/apache-maven-3.8.1# vi conf/settings.xml ... 146 <mirrors> 147 <!-- mirror 148 | Specifies a repository mirror site to use instead of a given repository. The repository that 149 | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used 150 | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. 151 | 152 <mirror> 153 <id>mirrorId</id> 154 <mirrorOf>repositoryId</mirrorOf> 155 <name>Human Readable Name for this Mirror.</name> 156 <url>http://my.repository.com/repo/path</url> 157 </mirror> 158 --> 159 <mirror> 160 <id>aliyunmaven</id> 161 <mirrorOf>central</mirrorOf> 162 <name>aliyun maven</name> 163 <url>https://maven.aliyun.com/repository/public</url> 164 </mirror> 165 <!-- <mirror> 166 <id>maven-default-http-blocker</id> 167 <mirrorOf>external:http:*</mirrorOf> 168 <name>Pseudo repository to mirror external repositories initially using HTTP.</name> 169 <url>http://0.0.0.0/</url> 170 <blocked>true</blocked> 171 </mirror> 172 --> 173 </mirrors> ...
1 2 3 4 5 6 7
#将maven bin目录加入系统PATH root@dify:/opt/maven/apache-maven-3.8.1# vi /root/.bashrc export M2_HOME=/opt/maven/apache-maven-3.8.1 export PATH=$PATH:$M2_HOME/bin