windows maven Installation and Configuration

Introduction

In order to be able to quickly install maven environment on the system, ready for such a small notebook.

Steps

  1. From maven official website to download maven;
  2. I want to extract the directory store, and create your own repository directory;
  3. Configuring environment variables maven, maven directly to the bin directory in the path to the configuration (Configuration Maven_Path feel no need), console runs mvn -version to see if the installation was successful;
    Run mvn command
  4. Modify the configuration file (maven directory /conf/settings.xml).
    • Modify warehouse storage path. modify In the path.
    • Add as Ali cloud image repository.
        <mirror>
            <id>alimaven-central</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
    • Modified version of the jdk compiled maven
        <profile>
            <id>jdk18</id>
            <activation>
                <jdk>1.8</jdk>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
                <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
            </properties>
        </profile>
    1. Configuring maven in the IDEA. Modify the path to: File> Setting> Build, Execution, Deployment> Build Tools> Maven.
      • Set the installation path maven, maven of setting the file path
        Modify Location
      • Configuring the Options = Runer in the VM -DarchetypeCatalog=internal. Dependent on local action is preferred exist.
      • Configuring importing, check what Automaticlly download the Source and Documentation. It is easy to see the source code.
    2. Create a new maven project, add guava rely on, and then see whether the warehouse download the corresponding package in the pom file.
    <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>28.1-jre</version>
    </dependency>

Reference material

Guess you like

Origin www.cnblogs.com/ydk-XL/p/11445313.html