Maven download Installation and use

Source: Internet
Author: User

Maven download installation and use first download maven

After downloading a good place to find a non-C disk of their own habits will be good to extract maven. Configure MAVEN Environment variables

This computer-right-properties-Advanced system settings-environment variables-add maven-home to System variables

Variable name: maven_home

Variable Value: D:\java\apache-maven-3.3.9

And then add maven-home to the path.

;%maven_home%\bin;

Test

After matching the early DOS input MVN-V test to see if it succeeds.


This is the configuration success

configuring Maven in Eclipse

Windows-preferences-maven-installation-add put you on the MAVEN for the introduction.

Create maven Project

Blank right key new Maven project

Next


To bring in the package you need.

Build a project under Src-main-java

If the packet is less, you can go to the Pom.xml to configure

http://mvnrepository.com/

http://mvnrepository.com/artifact/commons-logging/commons-logging/1.1

Find the package you want to refer to in the address above

For example, to find Org-apach-commons-logging.og

Click

Select version

Select Maven to know how to write in Pom.xml, just copy the past.

The configuration is OK, next is the project code that I want to write

Make the MAVEN project a jar bag

Add in the Pom.xml

<build>

<plugins>

<plugin>

<artifactId>maven-assembly-plugin</artifactId>

<version>2.2</version>

<configuration>

<archive>

<manifest>

<mainClass>com.bj58.worker.spider.run.Main</mainClass>

</manifest>

</archive>

<descriptorRefs>

<descriptorRef>

Jar-with-dependencies

</descriptorRef>

</descriptorRefs>

</configuration>

</plugin>

</plugins>

</build>

CMD under execution

D: Enter

Cd D:\java\workspace\allidayu Carriage return

MVN assembly:assembly

Typically under Target file

Java–jarssmsend-0.0.1-snapshot-jar-with-dependencise.jar

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.