Question 1,[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:Test (default-test) on project Motherbuyboot:there is test failures.[ERROR] Refer to D:\web\motherbuy\target\surefire-reports for the individual test results. [ERROR] Refer to dump files (if any exist) [Date]-jvmrun[n].dump, [Date].dumpstream and [Date]-jvmrun[n].dumpstream.F method: The JUnit version of the Pom,xml file is incorrect, or for other reasons, I will use JUnit dependency comment out, comp
This article uses MAVEN to build a spring boot app from scratch to publish a Web server that supports GRAPHQL.
1. Execution of MVN archetype:generate
Templates can be selected (but existing templates tend to keep up with technical advances), or they can just generate a basic MAVEN project.
2. Edit the generated pom.x
=falseSpring.datasource.test-while-idle=truespring.datasource.time-between-eviction-runs-millis=600000#spring. datasource.jdbc-interceptors=connectionstate; Slowqueryreport (threshold=0)# Specify the DBMS#spring. jpa.database = MYSQL# Show or not log for each SQL querySpring.jpa.show-sql = False# Hibernate DDL Auto (Create, Create-drop, update)Spring.jpa.hibernate.ddl-auto = Update# Naming strategySpring.jp
Introducing the LOG4J2 Log framework
The log4j2 is not introduced. LOG4J2 official website
Configuration of the scheme in Official document 77.2 Configure log4j for Logging1. Maven Dependency Configurationpom.xmlRemove Logback and introduce log4j22. Configuration files2.1 Log4j2.xmlUsing an XML format configuration file eliminates the need to add additional dependent libraries.2.2 Log4j2.yaml/log4j2.ymlUse the YAML/YML format
Idea: Maven supports the profile feature, when packaged with Maven profile, you can package the specified directory and specify the file, and you can modify the variables in the file. Spring boot also supports the profile feature, as long as you specify SPRING.PROFILES.ACTIVE=XXX in the application.properties file, whe
Every time eclipse uses the run as-a Maven install, it always runs JUnit test, some of which are associated with databases, and some are more dangerous. How do I skip the test skip testing?The Spring-boot-maven-plugin plugin has integrated the Maven-surefire-plugin plug-in t
Application is the boot module, the YML configuration file is configured in this moduleThe parent module does not configure the Packaging using the Package commandWhen the entire project is packaged as a jar,The submodule is packaged into a jar, and if you want to load the resource file in the code, you cannot use theresource.getFile(),应该使用resource.getInputStream().Spring
to choose an optimal version to ensure maximum expansion.What dependencies are maintained?Spring IO Platform maintains a lot of dependencies, picking out some common (see the official website for more details), as shown in the following table:
Group
Artifact
Version
Org.springframework.boot
bootmaven dependencies to pom.xml files
(3) Write startup class
(4) Running the program
1.2Hello of New
This step is very simple, compared to all of us, small in order to document the integrity of a brief description:
Start by using the IDE (ECLIPSE,MYECLIPSE) tool to create a new MAVEN project, either Maven Javaproject, or
One of MAVEN's main functions is to manage project dependencies, and Maven must uniquely identify them in order to be able to parse any one of the Java artifacts automatically, which is the underlying base of dependency management-the coordinates. 1. MAVEN coordinates
MAVEN defines a set of rules for unified management
The previous introduction of using the Spring-boot-maven-plugin plugin to hit the jar package will import all the dependent files and then become an executable jar package. The downside of this is that I don't actually need to break the dependent jar into the generated jar package, just package the code for the current project. The generated jar package can be ex
dependencies
Most dependency declarations contain only basic coordinates
2, the scope of dependence
MAVEN uses a set of CLASSPATH when compiling the main code, uses a different set of classpath when compiling and executing tests, and uses a set of classpath when it actually runs the project.The dependency range is used to control dependencies on relationships w
the actual project, you will have a large number of MAVEN modules, and you often find that these modules have a lot of dependencies are full projects, a module has a dependency on spring, B module also has, their dependency configuration is identical, the same groupid, Artifactid, version, or exclusions, Classifer. The attentive branch found that this was a repe
This article makes a brief introduction to some of the more important conceptual coordinates, dependencies, warehouses, and lifecycles in maven.1. About MAVEN coordinatesThe elements of MAVEN coordinates that distinguish any of the MAVEN world's components include GroupID, A
Some people think that Maven is a dependency management tool, of course the idea is wrong (specifically, MAVEN is a project management tool that runs through the lifecycle of the project, compiling, testing, packaging, publishing ...). , but Maven's impression of this error is also a reason, because Maven's dependency management is very strong, with Maven, you no
/-->In the above example, we declare a dependency on JUnit. Its groupid is JUnit, and its artifactid is JUnit,The version is 4.4. This group of Gav forms a Maven coordinate, based on which Maven can find the corresponding junit-4.4.jar file locally or in a remote repository.
Dependency Classification
As the project grows, your dependencies become more and more.
features of Spring boot
Spring projects that can be run independently: Spring boot can run independently as a jar package.
inline servlet container: Spring boot can choose t
In all previous spring boot and spring cloud related posts, the creation of the spring boot project will be involved. There are many ways to create them, either manually by Maven or through scaffolding, or by using the page tools
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.