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