zoukankan      html  css  js  c++  java
  • eclipse创建springboot项目

    eclipse创建springboot项目

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
    
      <parent>
          <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.1</version>
        <relativePath/> 
        <!-- lookup parent from repository -->
      </parent>
        
      <groupId>com.vfsd</groupId>
      <artifactId>Test5</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
    
      <name>Test5</name>
      <url>http://maven.apache.org</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
    
      <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </project>

     TestController2.java

    package com.vfsd.Test5;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    /**
     * Hello world!
     *
     */
    
    @SpringBootApplication
    public class App 
    {
        public static void main( String[] args )
        {
            System.out.println( "Hello World!" );
            SpringApplication.run(App.class, args);
        }
    }
    package com.vfsd.Test5.controller;
    
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    @RestController
    public class TestController2 {
    
        
        @GetMapping("/test2")
        public String test() {
            return "spring boot project2...";
        }
    }

     参考:https://start.spring.io/

    ##################################################

  • 相关阅读:
    Linux 编程笔记(四)
    渗透测试搜索指令整理(一)
    Linux 编程笔记(三)
    Winhex数据恢复笔记(五)
    Winhex数据恢复学习笔记(四)
    Winhex数据恢复学习笔记(三)
    Linux编程学习笔记(二)
    Linux编程学习笔记(一)
    工控系统安全问题汇总(一)
    WinHex数据恢复笔记(二)
  • 原文地址:https://www.cnblogs.com/herd/p/15665458.html
Copyright © 2011-2022 走看看