Spring Boot هو إطار جديد يوفره الفريق المحوري. تم تصميمه لتبسيط عملية البناء والتطوير الأولية لتطبيقات الربيع الجديدة. يدعو بشكل أساسي "القضاء على التكوين" ويحقق تكوين صفر.
لذا ، كيفية إنشاء مشروع Springboot في Idea؟
1. إنشاء وحدة ضمن المشروع الذي أنشأته. حدد الربيع initializr لإنشاء.
2. حدد من النوع: مشروع Maven (أداة بناء المشروع)
3. عند إنشاء تبعيات ، تحقق من الويب ، MyBatis ، و MySQL (هذا يعتمد على احتياجاتك الشخصية ، يمكنك اختياره بشكل مستقل)
هيكل المشروع المعمول به على النحو التالي:
ملف pom.xml المقابل
<؟ XSI: schemalocation = "http://maven.apache.org/pom/4.0.0 <soph> 0.0.1-snapshot </version> <packaging> جرة </packaging> <name> Demo </mame> <speciped> مشروع تجريبي لـ Spring Boot </speciped> <part> <roupiD> org.springframework.boot </rowiSid> <!-Lookup Parent from ropository-> </paret> <properties> <project.build.sourceencoding> utf-8 </project.build.sourceencoding> <project.reporting.outputencoding> utf-8 </project.reporting.utputencoding> <Eperenceies> <Rependency> <roupiD> org.mybatis.spring.boot </rougiD> <StifactId> mybatis-spring-boot-starter </stifactid> <sophy> 1.3.1 </version> </premitency> <sperency> <roupled> org.springframework.boot </grouped> <StifactId> Spring-boot-Starter-Web </stifactid> </sependency> <reperency> <roupiD> mysql </rougeid> <StifactId> mysql-connector-java </stiftId> <scope> وقت التشغيل </scope> </reperency> <StifactId> Spring-boot-starter-test </artifactid> <scope> اختبار </scope> </reperence> <!-c3p0 هذا ما قدمته يدويًا لأنني بحاجة إلى الاتصال بقاعدة البيانات-> <sperency> <sperence> com.mchange </groupiD> </sependencies> <build> <ultipins> <roupiD> org.springframework.boot </rougiD> <Stifactid> spring-boot-maven-plugin </suntifactid> </spliexin> </plugins> </build> </project>
application.yml (اسم لاحقة ملف التطبيق هذا عند إنشاء المشروع لا يسمى YML ، يوصى رسميًا بتغيير اللاحقة إلى YML ، والميزة هي أن الرمز له مطالبات)
MyBatis: mapper-locations: classpath: mapper/*.
.بدء
المقال أعلاه حول فكرة بناء مشروع Springboot بسرعة هو كل المحتوى الذي أشاركه معك. آمل أن تتمكن من إعطائك مرجعًا وآمل أن تتمكن من دعم wulin.com أكثر.