使用IDEA社区版创建SpringBoot项目

news2024/10/6 18:28:27

文章目录

  • 1.关于IDEA社区版的版本
  • 2.下载Spring Boot Helper
  • 3.创建项目
  • 4.配置Maven国内源
    • 4.1找不到settings.xml的情况
    • 4.2找得到settings.xml的情况
  • 4.3删除repository目录下的所有文件和目录
  • 5.加载项目
  • 6.解决`org.springframework.boot:spring-boot-starter-parent:pom:2.7.13.RELEASE was not found`

1.关于IDEA社区版的版本

专业版的IDEA可以直接创建SpringBoot项目,但是社区版就要下载Spring Boot Helper插件才能创建SpringBoot项目。

在这里插入图片描述

问题就在于Spring Boot Helper这个插件在新版本IDEA版本中是要收费的。
下面是这个插件官网中给出的一些版本信息。

在这里插入图片描述
在这里插入图片描述

Spring Boot HelperIDEA社区版的版本是绑定的,如果你想要用Spring Boot Helper的免费版本,就必须下载对应版本的IDEA社区版。如上图你可以下载2021.1-2022.1.4之间的版本,下面是官网的链接:

请添加图片描述

https://www.jetbrains.com/zh-cn/idea/download/other.html

往下滑就可以找到对应的版本了。

在这里插入图片描述

2.下载Spring Boot Helper

下载完对应的版本之后,进入IDEA的主界面。

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

下载完后点击Installed

在这里插入图片描述

>等待插件下载完即可

3.创建项目

下载完成后就可以创建项目了,下面是创建项目的步骤。

在这里插入图片描述

出现Spring Initializr的图标,说明插件装成功了。
没有出现这个图标,检查下载插件的时候有没有错。

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

点击next,继续着后面步骤操作

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

创建完成, 如下图:

在这里插入图片描述

项目创建好了,但是项目还没加载好,我们需要用Maven加载项目

在这里插入图片描述
在这里插入图片描述

接下来会切换到下面的界面:

在这里插入图片描述
如果出现很多报错的情况不要慌,这是正常的,下面解决Maven的问题。

4.配置Maven国内源

国外的Maven源,国内的网可能访问不到,或者很慢。所以需要将Maven换成国内的源。
下面开始操作:

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

4.1找不到settings.xml的情况

在这里插入图片描述

打开.m2目录后,找不到settings.xml
我已经上传了这个文件,滑到博客的最上面(需要VIP, CSDN是这样的)或者复制下面的代码手动创建一个settings.xml
而且已经配置好了国内源 , 直接把这个文件放到.m2目录下就行了。

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<!--
 | This is the configuration file for Maven. It can be specified at two levels:
 |
 |  1. User Level. This settings.xml file provides configuration for a single user,
 |                 and is normally provided in ${user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.conf}/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->

  <!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->

  <!-- offline
   | Determines whether maven should attempt to connect to the network when executing a build.
   | This will have an effect on artifact downloads, artifact deployment, and others.
   |
   | Default: false
  <offline>false</offline>
  -->

  <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
  </pluginGroups>

  <!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>

  <!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
  </servers>

  <!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
  <mirrors>
    <mirror>
      <id>aliyunmaven</id>
      <name>aliyun Maven</name>
      <mirrorOf>*</mirrorOf>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
  </mirrors>

  <!-- profiles
   | This is a list of profiles which can be activated in a variety of ways, and which can modify
   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
   | specific paths and repository locations which allow the build to work in the local environment.
   |
   | For example, if you have an integration testing plugin - like cactus - that needs to know where
   | your Tomcat instance is installed, you can provide a variable here such that the variable is
   | dereferenced during the build process to configure the cactus plugin.
   |
   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
   | section of this document (settings.xml) - will be discussed later. Another way essentially
   | relies on the detection of a system property, either matching a particular value for the property,
   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
   | Finally, the list of active profiles can be specified directly from the command line.
   |
   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
   |       repositories, plugin repositories, and free-form properties to be used as configuration
   |       variables for plugins in the POM.
   |
   |-->
  <profiles>
    <!-- profile
     | Specifies a set of introductions to the build process, to be activated using one or more of the
     | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
     | or the command line, profiles have to have an ID that is unique.
     |
     | An encouraged best practice for profile identification is to use a consistent naming convention
     | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
     | This will make it more intuitive to understand what the set of introduced profiles is attempting
     | to accomplish, particularly when you only have a list of profile id's for debug.
     |
     | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
    <profile>
      <id>jdk-1.4</id>

      <activation>
        <jdk>1.4</jdk>
      </activation>

      <repositories>
        <repository>
          <id>jdk14</id>
          <name>Repository for JDK 1.4 builds</name>
          <url>http://www.myhost.com/maven/jdk14</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>
    -->

    <!--
     | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
     | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
     | might hypothetically look like:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile>
      <id>env-dev</id>

      <activation>
        <property>
          <name>target-env</name>
          <value>dev</value>
        </property>
      </activation>

      <properties>
        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
      </properties>
    </profile>
    -->
  </profiles>

  <!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
  -->
</settings>

在这里插入图片描述

4.2找得到settings.xml的情况

找得到settings.xml,就要打开文件进行配置,很简单的一个操作,也是复制粘贴。

<mirror>
  <id>aliyunmaven</id>
  <name>aliyun Maven</name>
  <mirrorOf>*</mirrorOf>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

复制上面的代码,然后找到<mirrors>标签,将上面代码粘贴到<mirrors>标签下面。
替换掉原本的源,换成阿里云的源。

在这里插入图片描述

4.3删除repository目录下的所有文件和目录

在这里插入图片描述

5.加载项目

配置完国内源之后就可以,去IDEA中用Maven加载项目了。

在这里插入图片描述

重新加载后,大概率是下面这种情况

在这里插入图片描述

报错信息:

Could not find artifact org.springframework.boot:spring-boot-starter-parent:pom:2.7.13.RELEASE 
in aliyunmaven (https://maven.aliyun.com/repository/public)

6.解决org.springframework.boot:spring-boot-starter-parent:pom:2.7.13.RELEASE was not found

在这里插入图片描述

解决后如下图:

请添加图片描述

在这里插入图片描述

成功启动

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/768678.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

学员管理系统——面向对象

文章目录 前言基本思路Student.pymain.pyStudentManage.py菜单 menu()根据菜单实现程序的大概逻辑add_student() 添加学员信息delete_student() 删除学员信息modify_studnet() 修改学员信息search_student() 查找学员信息print_student() 显示所有学员信息save_student() 保存学…

使用qt的webengine让客户端嵌入网页

前提 在windows下&#xff0c;qt下 界面 用qt的界面设计拉上一些东西&#xff0c;一个跑按钮&#xff0c;一个刷新按钮&#xff0c;一个弹出框按钮&#xff0c;地址栏是为了填入新的https地址&#xff0c;一个verticalLayout是为了限定webengine的显示&#xff0c;需要包含 …

UI界面中的图标设计趋势与最佳实践

作为UI设计师&#xff0c;在日常的工作中&#xff0c;避免不了做图标规范。今天跟大家聊一聊&#xff0c;UI设计中的图标设计。 规范的重要性不用多说了&#xff0c;没有规范多个设计师绘制的图标会有很多差异&#xff0c;描边粗细、角度、圆角度等等。今天的文章和大家聊一下…

opencv-14 图像加密和解密

在OpenCV中&#xff0c;图像加密和解密是通过对图像像素进行一系列的变换和操作来实现的 通过按位异或运算可以实现图像的加密和解密。 通过对原始图像与密钥图像进行按位异或&#xff0c;可以实现加密&#xff1b;将加密后的图像与密钥图像再次进行按位异或&#xff0c;可以实…

MFC第十八天 非模式对话框、对话框颜色管理、记事本项目(查找替换、文字和背景色、Goto(转到)功能的开发)

文章目录 非模式对话框非模式对话框的特点非模式对话框与QQ聊天窗口开发非模态对话框&#xff08;Modeless Dialog&#xff09;和模态对话框&#xff08;Modal Dialog&#xff09;区别 记事本开发CFindReplaceDialog类的成员查找替换(算法分析)使用RichEdit控件 开发Goto(转到)…

Django实现接口自动化平台(十三)接口模块Interfaces序列化器及视图【持续更新中】

相关文章&#xff1a; Django实现接口自动化平台&#xff08;十二&#xff09;自定义函数模块DebugTalks 序列化器及视图【持续更新中】_做测试的喵酱的博客-CSDN博客 本章是项目的一个分解&#xff0c;查看本章内容时&#xff0c;要结合整体项目代码来看&#xff1a; pytho…

3.13 Bootstrap 页面标题(Page Header)

文章目录 Bootstrap 页面标题&#xff08;Page Header&#xff09; Bootstrap 页面标题&#xff08;Page Header&#xff09; 页面标题&#xff08;Page Header&#xff09;是个不错的功能&#xff0c;它会在网页标题四周添加适当的间距。当一个网页中有多个标题且每个标题之间…

MotionBert论文解读及详细复现教程

MotionBert&#xff1a;统一视角学习人体运动表示 通过学习人体运动表征&#xff0c;论文原作者提出了处理以人为中心的视频任务的统一方法。使用双流时空transformer&#xff08;DSTformer&#xff09;网络实现运动编码器&#xff0c;能够全面、自适应地捕获骨骼关节之间的远…

数据结构——六大排序 (插入,选择,希尔,冒泡,堆,快速排序)

1. 插入排序 1.1基本思路 把待排序的记录按其关键码值的大小逐个插入到一个已经排好序的有序序列中&#xff0c;直到所有的记录插入完为止&#xff0c;得到一个新的有序序列 我们熟知的斗地主就是一个插入排序 1.2 代码实现 我们这里将一个无序数组变成有序数组 插入排序时…

CVE-2017-15715

CVE-2017-15715 一、环境搭建二、漏洞原理三、漏洞复现 一、环境搭建 如下介绍kali搭建的教程 cd ~/vulhub/httpd/CVE-2017-15715 // 进入指定环境 docker-compose build // 进行环境编译 docker-compose up -d // 启动环境docker-compose ps使用这条命令查看当前正在…

放射显影多肽1778691-88-5,DOTA Methyltetrazine ,四甲基四嗪修饰大环配体

资料编辑|陕西新研博美生物科技有限公司小编MISSwu​ 中文名称&#xff1a;四甲基四嗪修饰大环配体 英文名称&#xff1a;FOLATE-NOTA&#xff0c; Methyltetrazine-DOTA 规格标准&#xff1a;1g、5g、10g CAS&#xff1a;1778691-88-5 分子式&#xff1a;C37H52N12O12 分子量…

学习opencv.js之基本使用方法(读取,显示,灰度化,边缘检测,特征值点检测)

opencv.js是什么 OpenCV.js 是 OpenCV&#xff08;Open Source Computer Vision Library&#xff09;的 JavaScript 版本。OpenCV 是一个广泛使用的计算机视觉和图像处理库&#xff0c;提供了一系列功能强大的算法和工具&#xff0c;用于处理图像、视频、特征提取、对象识别等…

php裁剪图片,并给图片加上水印

本次以裁剪四个图片为例&#xff0c;图片如下 代码如下 public function cutImg($imgUrl){try{// 读取原始图片$src_img imagecreatefromjpeg($imgUrl);// 获取原始图片的宽度和高度$src_width imagesx($src_img);$src_height imagesy($src_img);// 计算每个部分的宽度和高…

【C语言督学训练营 第十九天】关于C语言语法的一些补充

文章目录 1.条件运算符与逗号运算符2.自增自减运算符3.位运算4.switch do-while补充5.二维数组&二级指针6.总结 1.条件运算符与逗号运算符 条件运算符是C语言中唯一的一种三目运算符。三目运算符代表有三个操作数;双目运算符代表有两个操作数,如逻辑与运算符就是双目运算符…

传统工厂不再使用蓝牙LoRa而选择使用星斗1号之原因详解

物联网技术在不断发展的同时&#xff0c;化工企业对安全生产的重视也在逐渐增强。 在传统工厂进行安全管理数字化转型前&#xff0c;蓝牙Lora是其最为常用的化工人员定位技术&#xff0c;也曾广泛应用于工厂设备监控、数据传输、人员管理等。 然而&#xff0c;定位技术升级&a…

linux driver probe deferral 机制

1. 背景介绍 在偶然的一次实验中(具体是pinctrl实验)&#xff0c;我发现有些平台的pincontroller驱动起得很晚&#xff0c;而pinctrl client驱动却起得很早&#xff0c;在设备驱动模型中probe之前又会进行管脚复用的相关设置&#xff0c;按照常理来讲&#xff0c;这就产生了某…

前端工程中的设计模式应用

本文旨在系统性介绍一下23种设计模式&#xff0c;给出通俗易懂的案例、结构图及代码示例&#xff0c;这也是我自身学习理解的过程。或许其中的几种设计模式写的并不是很清晰明了易懂&#xff0c;更详细的可根据提到的参考文献进行深入学习。 什么是设计模式 设计模式这个概念是…

Python 算法基础篇之字符串操作:索引、切片、常用方法

Python 算法基础篇之字符串操作&#xff1a;索引、切片、常用方法 引言 1. 字符串的概念和创建2. 字符串的索引3. 字符串的切片4. 字符串的常用方法 a ) 查找子字符串 b ) 替换子字符串 c ) 拆分和连接字符串 总结 引言 字符串是一种常见的数据类型&#xff0c;在 Python 中对…

又整新活,新版 IntelliJ IDEA 有点东西!

作为一个经常使用IntelliJ IDEA来写代码的老用户&#xff0c;每次对于JetBrains软件的更新都是非常关注的。 这不最近这段时间&#xff0c;JetBrains连发了多个软件的EAP版本&#xff1a; 同时JetBrains的官博中也宣布了一个重要的新特性&#xff0c;那就是&#xff1a; 在所…