Create Spring Boot Project

Spring Initialzr ile: https://start.spring.io/ sitesinden projenizi oluşturup kullandığınız geliştirme ortamında açabilirsiniz. Spring Tool Suite / Eclipse ile: Eclipse/STS-> Workspace :D:\java\wosp-sts\PolEyB2BWoSp -> Launch-> File-> New-> Spring Starter Project Spring New Starter Project window: Service URL :https://start.spring.io Name :PolEyB2B Use default location :checked Type :Maven Packaging :Jar Java Version :11 Language :Java Group :net.yazilimcity Artifact :PolEy-b2b Version :0.0.1-SNAPSHOT Description :Pol Ey B2B Spring Boot Maven Project Package :net.yazilimcity.PolEy-> New Spring Starter Project Dependencies window: Spring Boot version :2.2.1 Selected :Spring Boot Dev Tools, Lombok, Spring Web-> New Spring Start Project window: Site Info-Base Url :https://start.spring.io/starter.zip Site Info-Full Url :https://start.spring.io/starter.zip?name=PolEyB2B&groupId=net.yazilimcity&artifactId=PolEy-b2b&version=0.0.1-SNAPSHOT&description=Pol+Ey+B2B+Spring+Boot+Maven+Project&packageName=net.yazilimcity.PolEy&type=maven-project&packaging=jar&javaVersion=11&language=java&bootVersion=2.2.1.RELEASE&dependencies=lombok&dependencies=devtools&dependencies=web -> Finish change .gitignore file content like that Çoklu Maven projesine çevirmek için aşağıdaki gibi pom parametresini yazabilirsiniz. add [code lang=”xml”] <packaging>pom</packaging> [/code] to pom.xml Eclipse/STS-> Project-> Properties-> Java Built Path-> Libraries : JRE System Library [JavaSE-11] (unbound)-> Edit-> JRE System Library window: Installed JREs…-> Add-> StandartVM-> Next-> JRE Definition window : JRE home :C:\Program Files\Java\jdk-11.0.2 JRE name :jdk-11.0.2-> Finish Select jdk-11.0.2-> Apply and Close-> Alternate JRE :jdk-11.0.2-> Finish-> Apply and Close Run PolEyB2BApplication main method without problem: Eclipse/STS-> MyApp-> Run-> Run As-> Java Application or Spring Boot App Or trigger with maven command from console. For run: [code lang=”shell”] D:\java\wosp-sts\PolEyB2BWoSp\PolEyB2B>mvn spring-boot:run [/code] Running without Maven messages: [code lang=”shell”] mvn -q spring-boot:run [/code] For debugging: [code lang=”shell”] D:\java\wosp-sts\PolEyB2BWoSp\PolEyB2B>mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug" [/code] For remote debugging: [code lang=”shell”] D:\java\wosp-sts\PolEyB2BWoSp\PolEyB2B>mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" [/code] Or remote debugging with pom.xml [code lang=”xml”] <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.2.2.RELEASE</version> <configuration> <jvmArguments> -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 </jvmArguments> </configuration> </plugin> [/code] Spring Boot projesini ayağa kaldırdığınızda aşağıdakine benzer bir çıktı görmelisiniz. [code lang=”shell”] . ____ _ __ _ _ /\\ / ___’_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | ‘_ | ‘_| | ‘_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ‘ |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.2.1.RELEASE) 2019-11-19 17:19:53.504 INFO 63020 — [ main] c.b.p.b2b.ui.PolEyB2BUIApp : Starting PolEyB2BUIApp v0.0.1-SNAPSHOT on E-NB518 with PID 63020 (D:\java\wosp-sts\PolEyB2BWoSp\PolEyB2B\PolEyb2b-ui\target\PolEyb2b-ui-0.0.1-SNAPSHOT.jar started by okinik in C:\Users\okinik\Desktop) 2019-11-19 17:19:53.509 INFO 63020 — [ main] c.b.p.b2b.ui.PolEyB2BUIApp : No active profile set, falling back to default profiles: default 2019-11-19 17:19:56.055 INFO 63020 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8150 (http) 2019-11-19 17:19:56.079 INFO 63020 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-11-19 17:19:56.081 INFO 63020 — [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.27] 2019-11-19 17:19:56.220 INFO 63020 — [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-11-19 17:19:56.220 INFO 63020 — [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2562 ms 2019-11-19 17:19:56.917 INFO 63020 — [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService ‘applicationTaskExecutor’ 2019-11-19 17:19:57.302 INFO 63020 — [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path ‘/actuator’ 2019-11-19 17:19:57.411 INFO 63020 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8150 (http) with context path ” 2019-11-19 17:19:57.420 INFO 63020 — [ main] c.b.p.b2b.ui.PolEyB2BUIApp : Started PolEyB2BUIApp in 4.843 seconds (JVM running for 5.581) 2019-11-19 17:30:38.018 INFO 63020 — [nio-8150-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet ‘dispatcherServlet’ 2019-11-19 17:30:38.018 INFO 63020 — [nio-8150-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet ‘dispatcherServlet’ 2019-11-19 17:30:38.030 INFO 63020 — [nio-8150-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 12 ms [/code] Git deposunda proje oluşturma: http://my.local.server/groups/YCNB2B -> New Project-> Project Path :PolEyb2b Description :Java 11, Spring Boot, Maven, YCNB2BPackage Visibility Level :Private-> Create Project Send Local Codes To The Remote Repository Via Git Bash: [code lang=”shell”] cd D:\java\wosp-sts\PolEyB2BWoSp\PolEyB2B git init git remote add origin http://my.local.server/YCNB2B/PolEyB2B.git git add . git commit git push -u origin master [/code] Çoklu modül oluşturmak için buradaki yazıyı okuyabilirsiniz. Jar oluşturmak için mvn clean package komutunu çalıştabilirsiniz ve sonrasında oluşan jar dosyasını aşağıdaki gibi ayağa kaldırabilirsiniz. D:\java\build>”c:\Program Files\Java\jdk-11.0.2\bin\java.exe” -jar poleyb2b-ui-0.0.1-SNAPSHOT.jar veya javaw komutu ile komut satırını kapattıktan sonra da uygulamanın arkaplanda çalışmasını sağlayabilirsiniz. javaw -jar my-app.jar daha fazla bilgi için spring.io/guides/gs/spring-boot/ IntelliJ IDEA ile Maven Project (Tek proje): IntelliJ Idea-> File-> New-> Project…-> Spring Initializr-> Project SDK: 1.8 Choose Initializr Service URL. Default: https://start.spring.io-> Next Project Metadata: Group: tr.com.at.hos.integration-rb Artifact: rb Type: Maven Project Language: Java Packaging: Jar Java Version: 8 Version: 0.0.1-SNAPSHOT Name: rb Description: Integration project for RB Package: tr.com.atp.hospitality.integration.rbi-> Next Dependencies: Spring Boot Actuator-> Next Project name: rb Project location: D:\\IdeaProjects\Integration-RB-> Finish-> Nex Window IntelliJ IDEA ile Maven POM (çoklu modül): IntelliJ Idea-> File-> New-> Project…-> Spring Initializr-> Project SDK: 1.8 Choose Initializr Service URL. Default: https://start.spring.io-> Next Project Metadata: Group: tr.com.at.hos.integration-rbi Artifact: integration-rb Type: Maven POM Language: Java Packaging: Jar Java Version: 8 Version: 0.0.1-SNAPSHOT Name: integration-rb Description: Integration RB MAVEN POM Package: tr.com.at.hospitality.integration.integrationrb-> Next Dependencies: -> Next Project name: integration-rb Project location: D:\\IdeaProjects\integration-rb-> Finish-> New Window pom.xml -> [code lang=”xml”] <packaging>pom</packaging> [/code] Integration-RB-> New-> Module-> Spring Initializr-> Project SDK: 1.8 Choose Initializr Service URL. Default: https://start.spring.io-> Next Project Metadata: Group: tr.com.at.hosp.integration-rb Artifact: rb Type: Maven Project Language: Java Packaging: Jar Java Version: 8 Version: 0.0.1-SNAPSHOT Name: rb Description: RB Package: tr.com.at.hos.integrationrb.rb-> Next Dependencies: Spring Boot Actuator-> Next Module Name: rb Content root: D:\IdeaProjects\integration-rbi\rb Module for location: D:\IdeaProjects\integration-rbi\rb-> Finish [code lang=”xml”] <parent> <groupId>tr.com.at.hos.integration-rb</groupId> <artifactId>integration-rb</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> [/code] Apache NetBeans ile: EasyEclipse ile: Spring Tool Suite 3 (STS) ile: Java Creator ile: Oracle JDeveloper ile: theia-ide ile: Daha fazla bilgi için aşağıdaki bağlantı adreslerini de inceleyebilirsiniz. spring.io guides/gs/spring-boot/ docs.spring.io Common Application properties dzone.com articles/spring-boot-quickstart baeldung.com spring-boot-start]]>

Leave a Reply

Your email address will not be published. Required fields are marked *