(1) 기본적으로 JAR 패키지 인 POM.XML의 <packaging> war </packaging> 파일을 수정하십시오. <FinalName> springBoot </finalName>을 <빌드> 노드에 추가하십시오. 즉, 전쟁 패키지의 이름이 생성됩니다. 완전한 pom.xml 파일 내용은 다음과 같습니다.
<? xml version = "1.0"encoding = "utf-8"?> <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> <groupid> springboot </groupid> <artifactid> springsboot> <버전> 0.0.1-snapShot </version> <parging> war </packaging> <name> springboot </name> <description> 스프링 부츠를위한 데모 프로젝트 </descript> <부모> <groupid> org.spramframewort.boot </groupid> <artifactid> spring-boot-starter-parent </artifactid> <version> </version>. 저장소에서 부모 조회-> </parent> <properties> <project.build.build.build.sourceencoding> utf-8 </project.build.sourceencoding> <project.Reporting.outputEncoding> utf-8 </project.reporting.outputencoding> <java.versition> 1.7 </java. <pectionency> <groupId> org.springframework.boot </groupid> <artifactid> Spring-Boot-Starter </artifactid> <exclusions> <exclusion> <groupId> org.spramewort.boot </groupid> <artifactid> spring-boot-spintarter-logging </artifactid> </fexcusion> </exclusion> <groupid> org.springframework.boot </groupid> <artifactid> Spring-boot-starter-web </arefactid> </fectionency> <pectionement> <groupid> org.spramframewort.boot </groupid> <artifactid> spring-boot-starter-test </arepifactid> </scope> </scope> </scope> </scope> <groupId> org.springframework.boot </groupid> <artifactid> Spring-Boot-Starter-Thymeleaf </arevactid> </eppendency> <pectionency> <groupId> org.springframewort </groupId> <artifactID> Spring-Boot-starter-log4J </artifactid> </.8.8 <pectionency> <groupId> org.springframework.boot </groupid> <artifactid> Spring-Boot-Starter-Data-Redis </artifactid> </dependency> <groupid> mysql </groupid> <tritifactid> mySQL-Connector-Java </arevactid> </delponemency> <groupid> org.mybatis.spring.boot </groupid> <artifactid> mybatis-spring-boot-starter </artifactid> <bersion> 1.1.1 </dependency> </fexendencies> <build> <finalname> springname> <plugin> <GroupSid> ORG.SPRONG.SPRONG.SPRONG.SPRONG.SPRONTH.SPRING.SPRONDIN <Artifactid> Spring-Boot-Maven-Plugin </artifactid> </plugin> </plugins> </build> </project>
(2) 프로젝트 시작 클래스를 수정하고 SpringBootservleTinitializer를 다음과 같이 상속합니다.
패키지 SpringBoot; import org.springframework.boot.springApplication; import org.springframework.boot.autoconfigure.springbootApplication; import org.spramframewort.boot.builder.springApplicationBuilder; import org.springframework.boot.web.support.springbootservletinitializer; import org.springframework.cache.annotation.enablecaching; import org.springframework.scheduling.annotation.enablescheduling;@springbootapplication@enablespictation@enablespictation@enablespictation SpringBootservleTinitializer {public static void main (String [] args) {springApplication.run (springbootApplication.class, args); } @override Protected SpringApplicationBuilder Configure (SpringApplicationBuilder Application) {return Application.Sources (SpringBootApplication.Class); }}(3) 포장 : Eclipse Run을 통해 -> Maven 설치로 -> maven 설치를 통해 설치하거나 프로젝트의 루트 디렉토리, 즉 pom.xml과 동일한 레벨 디렉토리를 입력하고 CMD 콘솔을 시작하고 MVN 설치 패키지를 실행할 수 있습니다.
(4) 환경 구성 (Linux Environment JDK 설치 및 Tomacat 설치 (SpringBoot가 TomCAT7 이상 지원)))
JDK 설치 참조 : //www.vevb.com/linuxjishu/66536.html
Tomcat 설치 참조 : //www.vevb.com/article/95272.htm
(5) 포장 된 전쟁 패키지를 Tomcat 디렉토리의 WebApp 디렉토리에 업로드하고 Tomcat 서버를 시작하십시오.
(6) 액세스 프로젝트 경로 : http : // IP 주소 : 포트 번호/프로젝트 포장 이름/메소드 이름 (프로젝트 포장 이름은 pom.xml에서 <finnalname>의 값입니다)
(7) 자동으로 Tomcat을 시작하도록 설정합니다
(1) 스크립트 파일 rc.local : vim /etc/rc.d/rc.local을 수정하십시오
(2) RC.local 추가 : 내보내기 java_home = jdk 설치 경로, Tomcat 설치 경로/bin/startup.sh start
위는이 기사의 모든 내용입니다. 모든 사람의 학습에 도움이되기를 바랍니다. 모든 사람이 wulin.com을 더 지원하기를 바랍니다.