idea配置maven教程

1.官网下载maven到本地,我的安装目录为:D:\softManager\install\maven-3.5.4\apache-maven-3.5.4

2.在\apache-maven-3.5.4新建文件夹:local_resposity

3.在安装目录下的conf下打开setting.xml:设置如下:

<localRepository>D:\softManager\install\maven-3.5.4\apache-maven-3.5.4\local_resposity</localRepository>设置maven下载jia包 的存放地址

<mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>central</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>

将国外的maven下载源换位国内aliyun镜像源,速度快100倍 

3.idea中配置maven:

关闭项目,到开始页面,点击confiure,全局配置:

 至此配置完毕。

修改

SprintbootApplication中的代码:
@SpringBootApplication
@RestController
public class SprintbootApplication {

    @RequestMapping("/helloboot")
    public String hello(){
        System.out.println("print hello to web page");
        return "hello spring boot";
    }
    public static void main(String[] args) {
        SpringApplication.run(SprintbootApplication.class, args);
    }
}

浏览器输入localhost:8080/helloboot可看到:

 

猜你喜欢

转载自blog.csdn.net/qq_41063141/article/details/83212845