Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Storm record-7 Murray-Maven installation and use

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Maven installation and use

Environmental preparation:

JDK1.6

Maven 3.0.4

Mveclipse8.6.1 (integrated mveclipse)

Before installing Maven, you need to make sure that JDK has been installed and configured. Maven is a project under Apache.

Download Maven http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz on the official website

Decompress or rename after the download is complete

Configure the Maven environment variable:

System variable: MAVEN_HOME = D:\ server\ maven

User variable: path =% MAVEN_HOME%\ bin

Open cmd and enter: mvn-version

Mvn is a command of Maven, mvn-version is to check the version information, if you can print and publish this information, it has been successfully installed on the computer.

Modify the location of the Maven warehouse:

Find the settings.xml configuration file under conf under Maven. By default, it is under the repository directory under .m2 under the current user.

Change to D:\ Repositorys\ maven

Enter in cmd and enter to execute: mvn help:system

At this point, maven will start downloading a lot of stuff from the remote warehouse, which will have to be downloaded sooner or later.

Maven configuration to myeclipse:

Open myeclipse,Window-> Preferences-- > MyEclipse-- > Maven4MyEclipse-- > Maven

Installations remove the default and add the Maven you just installed

User Settings sets the directory of Maven's settings.xml configuration file

Maven command set:

Create a normal Java project for maven:

Mvn archetype:create

-DgroupId=packageName

-DartifactId=projectName

Create the Web project for Maven:

Mvn archetype:create

-DgroupId=packageName

-DartifactId=webappName

-DarchetypeArtifactId=mvaen-archetype-webapp

Compile source code: mvn compile

Compile test code: mvn test-compile

Run the test: mvn test

Generate site:mvn site

Packaging: mvn package

Install jar:mvn install in the local Repository

Clear the resulting project: mvn clean

Generate the eclipse project: mvn eclipse:eclipse

Production idea project: mvn idea:idea

Use goal commands in combination, such as packaging without testing: mvn-Dtest package

The content of the compilation test: mvn test-compile

Only pack jar package: mvn jar:jar

Test but not compile, and do not test compilation: mvn test- skipping compile-skipping test-compile

Clear some system settings for eclipse: mvn eclipse:clean

Download the source file of the package: mvn dependency:sources

Commonly used commands:

Mvn package

Mvn eclipse:eclipse

Mvn compile

Mvn jar:jar

Mvn clean

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report