jdk1.8 Maven installation tutorial

 1, download java1.8 URL: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Download eclipse URL: http://www.onlinedown.net/soft/558304.htm

Download and install maven Address: http://maven.apache.org/download.html 

       First select Accept, and then select the file in the corresponding windows according to their own computers

 

 

    File jdk-8u131-windows-x64.exe after the download is complete

 

  2, to embark on the installation

      a, click Next default installation, but the choice of installation path, the default installation path is C: \ Program Files \ Java \ jdk1.8.0_131 \, we recommended to choose a single disk in the windows

           For installing software development, the future will be very easy to modify the path to G: \ Java \ jdk1.8.0_131 \

        

       b, default path next to corresponding mounting JRE: C: \ Program Files \ Java \ jre1.8.0_131 recommendations to modify the path: G: \ Java \ jre1.8.0_131

       C, the routine proceeds to wait for the completion of the installation, wherein the mounting path can be selected according to their own, is not recommended path exists characters, strings or special, JDK, and

             JRE is recommended to install in the same path.

  

   3, the installation was successful, start the configuration environment variable

      a, new user variable: JAVA_HOME G: \ Java \ jdk1.8.0_131

 

 

b, the new system variable CLASSPATH;.% JAVA_HOME% \ lib;% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ tools.jar

Note that the preceding symbol can not be omitted

 

 

 

c, to modify the system variable Path G: \ Java \ jdk1.8.0_131 \ bin; G: \ Java \ jre1.8.0_131;

Note that before and after the semicolon;

 

 d, click OK!

 

4, the javac input (as shown below) and in the CMD java -version, successful installation Congratulations

 

                                                       

 

                                            maven articles     
            
What 1 Maven that?
<span style = "color: # 000000"> <code> Apache Maven is a software project management and comprehension as a tool. It is based on the concept of a project object model (POM), you can manage a project's build, reporting and documentation generation from the project core information.

Maven is a project management and comprehension tool. Maven provides a complete building life cycle framework to developers. The development team spent almost no time you can use automation to build the basic framework of the project because Maven uses a standard directory structure and the default build lifecycle.

In the scene in the presence of multiple development teams, Maven can in a very short period of time to establish a standard way of working. Because most of the project configuration is simple and reusable, Maven simplifies the developers work on creating reports, inspection, build and test automation configuration.
</ code> </ span>
. 1
2
. 3
. 4
. 5
. 6
Maven provides a way for the developer to manage the process of:

Construction of the project (Builds) 
documentation (Documentation) 
report (Reporting) 
project dependencies (Dependencies) 
software configuration management (SCMs) 
release (Releases) 
distribution (Distribution) 
mailing list (mailing list)

Overall, Maven simplify and unify the process of project construction. It seamlessly handles project to compile, distribute, documents, team work and other tasks, increasing the reusability tasking and can handle most of the building-related tasks.

maven when the project is created, it will use the default project structure, developers only need to be placed in accordance with the corresponding files without the need to do any configuration in the pom.xml file. 
The following is a maven project to create the resulting file structure. 


2, the environment structures
2.1 JDK installation
maven is a java-based project management tool, so before installation maven maven first need to see if already installed the JDK.

In the windows environment: 
At the command line, run java -version, if the output of the following results, has been installed on behalf of jdk

 

Otherwise, you need to download and install JDK.

2.2 Download and install maven
Download: 
http://maven.apache.org/download.html 
will unzip the downloaded file to the directory you want to install. For example: 
D: \-the Apache Maven-3.5.0-bin

2.3 Configuration Environment Variables
configuration MAVEN_HOME environment variable, whose value is just extracted directory: 
D: \ Apache-Maven-3.5.0-bin \ Apache-3.5.0-Maven 
add a variable in the path: 
% MAVEN_HOME% \ bin

2.4 Verify whether maven installed
at the command line command 
mvn -version 
If the following results appear, successful installation configuration. 
 
The above-described operation is completed can be used a maven.

2.5 maven local repository of configuration
maven repository of three types:

Local repository (local) 
Central warehouse (central) 
remote repository (remote)

Maven local repository is a directory on your computer address, Maven local repository holds all the dependencies of your project (library, jar package plug-ins, etc.). When you run the Maven build, Maven will automatically download all the dependent jar package to the local repository. This will help avoid each project build dependencies reference for the project are stored on the remote host.

There in the apache-maven-3.5.0 \ conf path setting.xml a file, open the file, which has a localRepository label, set its value to the path of your local warehouse.

The above has been configured maven environment, but if you want to use in the IDE, IDE-related configuration needs to be done, this article will explain the eclipse of configurations.

3 eclipse maven plugin configuration
3.1 maven plugin download and install
the new version of the eclipse, the general maven plugin has been installed by default, if you have not maven IDE plug-in installed, you need to download the plug-in plug-m2e market.

3.2 configuration environment
in the window-preference-Maven-User Settings , configure the file path of the maven settings.xml.

 

In the window-preference-Maven-Installations, the configuration of the installation path maven.

 

Such an environment maven build better. 
Here you can use the plugin to create maven maven project.

4 Create a maven project
in the file-new-other, select maven project.

 

This article only demonstrates how to create a web project, other types of items, too, maven plugin provides a template to create a variety of project types.

 

 

 

The above operation occurred several concepts: 
groupId (project organization), artifactId (project name), version (version number), so that we can uniquely identify a project.

Specific meaning as follows:

 

This creates a web project.

5 maven web project structure
below to the author before already created maven web project as an example, briefly explain the structure maven project.

 

(1) src / main / java : placing directory java source file 
(2) src / main / resources : the resource file, e.g., attributes file, etc. 
(3) At the same time, placed webapp directory is lib file directory (this is the author himself It created primarily used to place the jar package to import their own, rather than by relying on) and the web.xml maven pom file to import.

Note: This may be the most web.xml file maven beginning may not help you generate, the following error message appears:

<span style="color:#000000"><code>Description Resource Path Location <span style="color:#000088">Type</span> web.xml <span style="color:#000088">is</span> missing <span style="color:#000088">and</span> <failOnMissingWebXml> <span style="color:#000088">is</span> <span style="color:#000088">set</span> <span style="color:#000088">to</span> <span style="color:#000088">true</span> pom.xml /maven line <span style="color:#006666">6</span> Maven Java EE Configuration Problem</code></span>
1
但是可以自己手动生成,解决xml没有生成的办法

(4) src / test / java: test code storage directory

classes the path (5) target directory is stored in the compiled class files, the above corresponds to src / main / java, stored in the test-classes of the test class file directory.

pom.xml file under (6) project root directory is the most important maven project in a file.

POM is intended for the project object model (Project Object Model), Maven is the basic unit. It is an XML file named pom.xml always exist on more projects under the directory. 
POM contains information related to various projects and Maven used to construct one or more items of configuration details. 
POM also contains a variety of operational goals (goal) and plug-ins. When performing a task or objective operations, Maven POM looks in the current directory. Read Maven POM, derive the required configuration information, and then perform the target operation. Maven can clearly part of the configuration from the POM listed below:

Project dependencies (project dependencies) 
plug-ins (plugins) 
target operation (goals) 
to build (build profiles) 
version of the project (project version) 
Developers (developers) 
mailing list (mailing list)

For starters, we are most concerned about is the project dependencies, dependency labels in the pom file is the definition of a dependency. If we need to introduce a dependency, you can find what you're looking jar wrapped in http://mvnrepository.com/ then, you can find such content below the red line contents are copied directly to the pom file label next level.

 

Such maven plugin will download the appropriate jar own bag, and store in your local repository, if the jar package has a local warehouse, then the next time if you use the same jar package, it will directly drinking the local repository the jar package.

For file directory structure above maven generated accordingly may modify their own configuration.

 

Here you can define your own path to deployment. For file directory can also remove the need to deploy the appropriate files.

Summary:
This paper stresses the installation configuration maven, eclipse directory structure definition of the relevant configuration, as well as pom files, maven, and how to create a maven project, maven project deployment problems. 
Address: HTTPS: //blog.csdn.net/wk1134314305/article/details/75048030 
----------------
Disclaimer: This article is CSDN blogger "xiegongmiao" original articles, follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/xiegongmiao/article/details/81206975

Guess you like

Origin www.cnblogs.com/joingyb/p/11531027.html