It only takes five minutes - Quickly build SpringCloud microservices with Maven


Maven Installation Manual

If you want to learn Java engineering, high performance and distributed, in-depth. Microservices, Spring, MyBatis, Netty source code analysis of friends can add my Java advanced communication: 854630135, the group has a live Ali bull to explain the technology, as well as Java large Internet technology video free to share to everyone.

1、Prepare the installation package

  installer: apache-maven-3.5.4-bin.zip ( preferablyJDK 1.7 and above)

   Integration package: eclipse-maven3-plugin.zip

2、maven installation

   2.1 Unzip the downloaded maven installation package to the directory of your hard drive where you want to put it

     example:H:mavenapache-maven-3.5.4

   2.2 Configure environment variables

      MAVEN_HOME = H:mavenapache-maven-3.5.4

      path = %MAVEN_HOME%in;

   2.3 Verify that the installation was successful

     If you type: mvn -v in the console, you will see the maven version information, indicating a successful installation.

   2.4 Warehouse configuration

     A) Local repository path setting

     Locate the settings.xml configuration file locally in the maven installation directory under conf, mine is in H:mavenapache-maven-3.5.4confsettings.xml, find the localRepository tab of the configuration path and match the path to the maven installation as follows.

     B) Download the jar packages and other resources needed for the repository

     At the console, enter:mvn help:system, will downloadmaven requisitejar package resource。 If the following error occurs:No plugin found for prefix 'help' in the current project and in the plugin

Just change the mirror address of the maven repository to.http://repo1.maven.org/maven2

     After changing to the above address, then type mvn help:system command in the cmd command panel to check if it is successful, as shown below, it is both successful.

     At this point, the Maven installation is complete.

3, Eclipse integration

   By link

     A) Create two folders in the root directory of your eclipse installation: links and mavenPlugins, put the integrated jar package (eclipse-maven3-plugin.zip) after decompressing the features and plugins folders into the mavenPlugins folder.

     B) Create a maven.link file in the links directory, and in it, configure path=pathmavenPlugins with the absolute path to

     i.e. path= path=H:\eclipse\mavenPlugins

    C) reopen eclipse, After it starts you openWindow->Preferences, If it appearsMaven options, Indicates successful integration configuration!

     Checking the maven configuration in eclipse

     turnwindow->Preferences->maven->User Setting, inspections User Setting(open file) Whether the path under is the default repository path, If so, change it to our ownsettings.xml trails:

    H:mavenapache-maven-3.5.4confsettings.xml。

     This concludes the configuration.

4, using Maven in eclipse to quickly build spring cloud microservices

(1) Create a new Maven project

(2) Select maven-archetype-quicktype

(3) Enter the group id, artifact id, etc. and click Finish

(4) The project is structured as shown

(5) Add spring cloud configuration to the pom file.

(6) Writing Application programs

(7) Execute the Application program, if there is no error output means spring boot has been built successfully.

If unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean appears. Then it is a jar package conflict, mine is a tomcat conflict, find the tomcat location in the local repository, the downloaded tomcat jar package can be deleted, we use their own jdk1.7.


Recommended>>
1、Hack WeChat minigame for Android with Kotlin Jump One Jump
2、What to do to avoid secondary data destruction after losing data on your computer phone
3、Over 600 years old and 240 pages thick the mysterious Voynich manuscript has now been deciphered by artificial intelligence
4、Are drones safe Will the driver be laid off The Minister of Industry and Information Technology responds
5、Twitter hot list management cannot be trusted

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号