Download installation and custom jar package handling for MAVEN in spring boot

Source: Internet
Author: User
Tags aliyun

First, Download:

· Java Development Environment (JDK)

· Maven Download Address: http://maven.apache.org/release-notes-all.html

Download the latest version of the Bin folder, as shown in the following figure:


Second, installation

Installing MAVEN is super simple, with a total of four steps:

1. Download Maven, in fact, is a compressed package, decompression


2. New environment variable Maven_home


3. Path to join Maven's bin in path

Third, verify whether the installation is successful

Open the Command window, enter MVN–V press ENTER to see if the correct output of MAVEN version information is as follows:


Iv. Configuring the address of the MAVEN library

Maven places the Downloaded class library (jar package) in a local directory, and if you want to redefine the location of the directory, you need to modify the configuration of the Maven local repository:

Modified files: D:\maven\apache-maven-3.2.3\conf\setting.xml

<settingsxmlns= "http://maven.apache.org/SETTINGS/1.0.0"

Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"

xsi:schemalocation= "Http://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsd" >

<!--localrepository

| The path to the local repository maven would use to store artifacts.

|

| Default: ${user.home}/.m2/repository

<localRepository>/path/to/local/repo</localRepository>

-

<localRepository>D:\maven\repository</localRepository>

</settings>

Based on this configuration, MAVEN will save the downloaded class library to D:\maven\repository.

Note: You can set the address to the address of the MAVEN local library installed by Eclipse Online:

C:\Users\ Bamboo Language Xuan \.m2\repository

Experiment with what we just did. No, console input:

MVN Help:system

The effect is as shown in the figure:

If there is no problem, after executing the command, there will be many more files under D:\maven\repository, the files that Maven downloads from the central repository to the local repository, and Maven has started working for us.

Import the local jar package into the local MAVEN library:

In the command window, you typed the command: Mvninstall:install-file-dfile=jar the location of the package-dgroupid= custom groupid-dartifactid= custom artifactid-dversion= Custom Version-dpackaging=jar

such as: mvninstall:install-file-dfile=d:\lib\aliyun-sdk-mns-1.1.8.jar-dgroupid=aliyun-message-sdk-mns-dartifactid= Aliyun-message-sdk-mns-dversion=1.1.8-dpackaging=jar

Vi. Setting the Maven address in Eclispe:


Set User Setting:


Note: If you finish editing, the item is packaged with an error:


Remember to restart the Eclise and pack again.

Reference URL:

Https://stackoverflow.com/questions/24398561/eclipse-error-cant-find-maven-installation

7, modify the Pom.xml file local jar package to introduce the same as the ordinary jar package

The local jar package is bundled into the project's jar package after packaging.

Attention:

Common development, can directly introduce the jar package to the specified folder in the project

When the project is packaged into a jar package, the jar package needs to be imported into the local MAVEN library and modified by eclipse Maven as a locally installed MAVEN repository;

You can also not modify the Maven warehouse address of Eclipse, directly the jar package through the command if the local installed MAVEN, and then copy the corresponding jar package files to the Eclipse online installation directory address, such as: C:\Users\ Bamboo Xuan \.m2\ Repository

Modify the introduction of the jar package in the Pom.xml file in the same way as the normal jar package, as shown in the following figure, after the project is recompiled and packaged or run:


Reference URL: http://blog.csdn.net/Colton_Null/article/details/77510141

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.