======================================================== the first part of =================================================== ==========
Part I: Package a MAVEN Web project into a war package using the plugin that comes with the MAVEN project
The project used is the MAVEN project in the previous chapter, intact
Check out the Pom.xml file
<Projectxmlns= "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>Com.sxd.springBootExample</groupId> <Artifactid>Firstspringbootexample</Artifactid> <version>0.0.1-snapshot</version> <Packaging>War</Packaging> <Build> <Plugins> <plugin> <Artifactid>Maven-war-plugin</Artifactid> <Configuration> <version>3.0</version> </Configuration> </plugin> </Plugins> </Build> <!--The introduction of the parent project, in fact, is a project jar, version of their own in the http://mvnrepository.com/search?q=spring-boot-starter-parent selection can - <Parent> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-parent</Artifactid> <version>1.5.7.RELEASE</version> </Parent> <!--to run a Web project, just introduce this jar, the version is not written, the parent has declared the - <Dependencies> <Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-starter-web</Artifactid> </Dependency> </Dependencies> </Project>
View Code
1. Right-click Project--->debugs as--->debugs configurations
2. Follow the steps to go
3. Error:
No compiler is provided in this environment. Perhaps running on a JRE rather than a JDK
[INFO] Scanning for projects ... [INFO] [INFO] Using the builder Org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread Count of 1[info] [INFO]-------------------------- ----------------------------------------------[INFO] Building firstspringbootexample 0.0.1-snapshot[info]-------- ----------------------------------------------------------------[INFO] [INFO]---maven-clean-plugin:2.6.1:clean ( Default-clean) @ firstspringbootexample---[info] Deleting d:\workspace2\firstspringbootexample\target[info] [INFO]- --Maven-resources-plugin:2.6:resources (default-resources) @ firstspringbootexample---[INFO] Using ' UTF-8 ' encoding To copy filtered resources. [INFO] Copying 0 Resource[info] Copying 0 Resource[info] [INFO]---maven-compiler-plugin:3.1:compile (default-compile) @ firsts Pringbootexample---[INFO] changes detected-recompiling the module! [INFO] Compiling 1 source file to D:\workspace2\firstspringbootexample\target\classes[info]----------------------------------------------------- --------[ERROR] Compilation error: [INFO]-------------------------------------------------------------[ERROR] No Compiler is provided in this environment. Perhaps is running on a JRE rather than a JDK? [INFO] 1 Error[info]-------------------------------------------------------------[INFO]------------------------- -----------------------------------------------[INFO] BUILD Failure[info]--------------------------------------- ---------------------------------[INFO] Total time:2.398 s[info] finished At:2017-10-01t17:41:26+08:00[info] Final Memory:13m/232m[info]------------------------------------------------------------------------[ERROR] Failed to Execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (Default-compile) on project Firstspringbootexample:compilation Failure[error] No compiler is provided in this environment. Perhaps you is running on A JRE rather than a JDK? [ERROR], [Help 1][error] [ERROR]-See the full stack trace of the errors, re-run Maven with THE-E switch. [ERROR] Re-run Maven using The-x switch to enable full debug logging. [ERROR] [ERROR] For more information on the errors and possible solutions, please read the following articles:[error] [Help 1] http://c Wiki.apache.org/confluence/display/maven/mojofailureexception
View Code
Workaround: http://www.cnblogs.com/sxdcgaq8080/p/7617542.html
4. After resolving the error, re-package the operation
5. After implementation, the results are as follows:
===================================================== Part II ====================================================== ===
Part II, using the plug-in provided by Springboot, package the project as a jar package
"Spring Boot" 2. Package the Spring boot project with the war package and jar package on myecplise