精华内容
下载资源
问答
  • eclipse中使用maven配置步骤。 一、首先需要配置好环境 1.下载JDK,配置环境变量。安装eclipse。 2.下载maven.zip,解压,配置环境变量。 3.在cmd 中使用java -version查看jdk是否配置好 4.在cmd 中使用mvn -v...

    eclipse中使用maven,配置步骤。
    一、首先需要配置好环境
    1.下载JDK,配置环境变量。安装eclipse。
    2.下载maven.zip,解压,配置环境变量。
    3.在cmd 中使用java -version查看jdk是否配置好
    4.在cmd 中使用mvn -v查看maven是否配置好

    二、接下来,在config文件夹中的setting.xml文件内配置maven 的国内镜像仓库,创建本地仓库,并在setting.xml中配置。

    三、接着,在eclipse中配置。依次点击window/preferences 在搜索栏中输入maven 接着点击user setting
    点击global setting 中的 browse 找到config中的setting.xml文件
    点击user setting 中的 browse 找到本地仓库中的setting.xml文件
    点击Update setting
    apply
    apply and close

    四、最后,创建maven工程。
    在pom.xml文件中添加自己所需要的jar包依赖

    五.创建maven项目成功之后,注意pom.xml文件

    展开全文
  • Maven的安装与配置

    万次阅读 多人点赞 2019-09-04 19:48:17
    Maven超详细安装与配置步骤

    一、安装本地Maven

    tips: 官网为外网,下载速度较慢,这里提供3.6.3版本的三方链接下载Maven下载

    1. 无视下载速度以及需要其他版本的伙伴点此进入Maven官网下载

    2. 选择左侧Download
      在这里插入图片描述

    3. 点击箭头所指的链接进行下载
      在这里插入图片描述

    4. 下载完成后,选择一个路径进行解压

    5. 然后配置path环境变量,如图

    • 系统变量:MAVEN_HOME = F:\dev\apache-maven-3.6.1
    • 系统变量:path = %MAVEN_HOME%\bin
      MAVEN_HOME:
      在这里插入图片描述

    在这里插入图片描述

    path:
    在这里插入图片描述

    1. 然后win+R 运行cmd 输入 mvn -version,如图所示则配置成功

    在这里插入图片描述

    二、配置settings文件

    1. 在F:\dev\apache-maven-3.6.1\conf下可以找到settings文件,打开(嫌麻烦的直接看最后一步)

    2. 找到第52行,这里是maven默认的仓库
      在这里插入图片描述

    3. 我们复制第53行

    <localRepository>/path/to/local/repo</localRepository>
    

    将它拿到注释外并将中间的内容改成你需要的路径,如图

    <localRepository>F:/repository</localRepository>
    

    这里的路径随便设置,注意这里是正斜杠
    在这里插入图片描述

    1. 因为国外的服务器下载jar包很慢所以我们改为阿里云服务器(大约在150行左右),这两个仓库只用选一个(根据大家反馈建议使用第一个,第二个在有的版本可能会出现warning)
     <!-- 阿里云仓库 -->
            <mirror>
                <id>alimaven</id>
                <mirrorOf>central</mirrorOf>
                <name>aliyun maven</name>
                <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
            </mirror>
         或者
          <mirror>
    		<id>nexus-aliyun</id>
    		<mirrorOf>*</mirrorOf>
            <name>Nexus aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    	 </mirror>
    
    
    1. 如图,要夹在两个mirrors标签之间
      在这里插入图片描述

    2. 在最后配置jdk,也要夹在两个profiles标签之间(我这里使用的为jdk8)

    <!-- java版本 --> 
    <profile>
          <id>jdk-1.8</id>
          <activation>
    	    <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
          </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. 配置完成,在命令行输入mvn help:system测试,看到下载链接里面是ailiyun的链接表示配置成功

    2. 嫌麻烦的直接复制配置文件的内容即可,不过路径还是要改(参考第3步)

    <?xml version="1.0" encoding="UTF-8"?>
    
    <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
    
    <!--
     | This is the configuration file for Maven. It can be specified at two levels:
     |
     |  1. User Level. This settings.xml file provides configuration for a single user,
     |                 and is normally provided in ${user.home}/.m2/settings.xml.
     |
     |                 NOTE: This location can be overridden with the CLI option:
     |
     |                 -s /path/to/user/settings.xml
     |
     |  2. Global Level. This settings.xml file provides configuration for all Maven
     |                 users on a machine (assuming they're all using the same Maven
     |                 installation). It's normally provided in
     |                 ${maven.conf}/settings.xml.
     |
     |                 NOTE: This location can be overridden with the CLI option:
     |
     |                 -gs /path/to/global/settings.xml
     |
     | The sections in this sample file are intended to give you a running start at
     | getting the most out of your Maven installation. Where appropriate, the default
     | values (values used when the setting is not specified) are provided.
     |
     |-->
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
      <!-- localRepository
       | The path to the local repository maven will use to store artifacts.
       |
       | Default: ${user.home}/.m2/repository
      <localRepository>/path/to/local/repo</localRepository>
      -->
    <localRepository>F:/repository</localRepository>
      <!-- interactiveMode
       | This will determine whether maven prompts you when it needs input. If set to false,
       | maven will use a sensible default value, perhaps based on some other setting, for
       | the parameter in question.
       |
       | Default: true
      <interactiveMode>true</interactiveMode>
      -->
    
      <!-- offline
       | Determines whether maven should attempt to connect to the network when executing a build.
       | This will have an effect on artifact downloads, artifact deployment, and others.
       |
       | Default: false
      <offline>false</offline>
      -->
    
      <!-- pluginGroups
       | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
       | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
       | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
       |-->
      <pluginGroups>
        <!-- pluginGroup
         | Specifies a further group identifier to use for plugin lookup.
        <pluginGroup>com.your.plugins</pluginGroup>
        -->
      </pluginGroups>
    
      <!-- proxies
       | This is a list of proxies which can be used on this machine to connect to the network.
       | Unless otherwise specified (by system property or command-line switch), the first proxy
       | specification in this list marked as active will be used.
       |-->
      <proxies>
        <!-- proxy
         | Specification for one proxy, to be used in connecting to the network.
         |
        <proxy>
          <id>optional</id>
          <active>true</active>
          <protocol>http</protocol>
          <username>proxyuser</username>
          <password>proxypass</password>
          <host>proxy.host.net</host>
          <port>80</port>
          <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
        </proxy>
        -->
      </proxies>
    
      <!-- servers
       | This is a list of authentication profiles, keyed by the server-id used within the system.
       | Authentication profiles can be used whenever maven must make a connection to a remote server.
       |-->
      <servers>
        <!-- server
         | Specifies the authentication information to use when connecting to a particular server, identified by
         | a unique name within the system (referred to by the 'id' attribute below).
         |
         | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
         |       used together.
         |
        <server>
          <id>deploymentRepo</id>
          <username>repouser</username>
          <password>repopwd</password>
        </server>
        -->
    
        <!-- Another sample, using keys to authenticate.
        <server>
          <id>siteServer</id>
          <privateKey>/path/to/private/key</privateKey>
          <passphrase>optional; leave empty if not used.</passphrase>
        </server>
        -->
      </servers>
    
      <!-- mirrors
       | This is a list of mirrors to be used in downloading artifacts from remote repositories.
       |
       | It works like this: a POM may declare a repository to use in resolving certain artifacts.
       | However, this repository may have problems with heavy traffic at times, so people have mirrored
       | it to several places.
       |
       | That repository definition will have a unique id, so we can create a mirror reference for that
       | repository, to be used as an alternate download site. The mirror site will be the preferred
       | server for that repository.
       |-->
      
        <!-- mirror
    	<mirrors>
         | Specifies a repository mirror site to use instead of a given repository. The repository that
         | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
         | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
         |
        <mirror>
          <id>mirrorId</id>
          <mirrorOf>repositoryId</mirrorOf>
          <name>Human Readable Name for this Mirror.</name>
          <url>http://my.repository.com/repo/path</url>
        </mirror>
    	 </mirrors>
         -->
         <!-- 阿里云仓库 -->
     <mirrors>
    	 <mirror>
    			<id>nexus-aliyun</id>
    			<mirrorOf>*</mirrorOf>
    			<name>Nexus aliyun</name>
    			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
    	</mirror>
    </mirrors>
      <!-- profiles
       | This is a list of profiles which can be activated in a variety of ways, and which can modify
       | the build process. Profiles provided in the settings.xml are intended to provide local machine-
       | specific paths and repository locations which allow the build to work in the local environment.
       |
       | For example, if you have an integration testing plugin - like cactus - that needs to know where
       | your Tomcat instance is installed, you can provide a variable here such that the variable is
       | dereferenced during the build process to configure the cactus plugin.
       |
       | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
       | section of this document (settings.xml) - will be discussed later. Another way essentially
       | relies on the detection of a system property, either matching a particular value for the property,
       | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
       | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
       | Finally, the list of active profiles can be specified directly from the command line.
       |
       | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
       |       repositories, plugin repositories, and free-form properties to be used as configuration
       |       variables for plugins in the POM.
       |
       |-->
        <!-- profile
    	<profiles>
         | Specifies a set of introductions to the build process, to be activated using one or more of the
         | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
         | or the command line, profiles have to have an ID that is unique.
         |
         | An encouraged best practice for profile identification is to use a consistent naming convention
         | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
         | This will make it more intuitive to understand what the set of introduced profiles is attempting
         | to accomplish, particularly when you only have a list of profile id's for debug.
         |
         | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
        <profile>
          <id>jdk-1.4</id>
    
          <activation>
            <jdk>1.4</jdk>
          </activation>
    
          <repositories>
            <repository>
              <id>jdk14</id>
              <name>Repository for JDK 1.4 builds</name>
              <url>http://www.myhost.com/maven/jdk14</url>
              <layout>default</layout>
              <snapshotPolicy>always</snapshotPolicy>
            </repository>
          </repositories>
        </profile>
        -->
    
        <!--
         | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
         | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
         | might hypothetically look like:
         |
         | ...
         | <plugin>
         |   <groupId>org.myco.myplugins</groupId>
         |   <artifactId>myplugin</artifactId>
         |
         |   <configuration>
         |     <tomcatLocation>${tomcatPath}</tomcatLocation>
         |   </configuration>
         | </plugin>
         | ...
         |
         | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
         |       anything, you could just leave off the <value/> inside the activation-property.
         |
        <profile>
          <id>env-dev</id>
    
          <activation>
            <property>
              <name>target-env</name>
              <value>dev</value>
            </property>
          </activation>
    
          <properties>
            <tomcatPath>/path/to/tomcat/instance</tomcatPath>
          </properties>
        </profile>
    	  
        -->
    <profiles>
    <profile>
          <id>jdk-1.8</id>
          <activation>
    	    <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
          </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>
    </profiles>
    
    
    
      <!-- activeProfiles
       | List of profiles that are active for all builds.
       |
      <activeProfiles>
        <activeProfile>alwaysActiveProfile</activeProfile>
        <activeProfile>anotherAlwaysActiveProfile</activeProfile>
      </activeProfiles>
      -->
    </settings>
    
    
    
    展开全文
  • maven配置步骤

    2018-06-26 16:46:18
    maven 在 eclipse中的配置 新手搭建maven工程,遇到maven配置问题,搭配完自己总结的
  • 一、 下载maven的安装包 下载地址:https://maven.apache.org/download.cgi 二、下载完成,解压到D盘 三、配置环境变量,新建MANEN_HOME环境变量 四、配置...

    一、 下载maven的安装包

              下载地址:https://maven.apache.org/download.cgi

    二、下载完成,解压到D盘

               205800_fBe7_3673274.png 

    三、配置环境变量,新建MANEN_HOME环境变量

                205929_dJyl_3673274.png

    四、配置Path环境变量,加入%MANEN_HOME%\bin

                210106_wdfs_3673274.png

    五、在cmd命令行输入:mvn -version

                210247_kNeV_3673274.png

    六、打开maven文件夹中的conf文件夹里的settings.xml文件,配置本地仓库路径,便于以后的依赖包的管理和查看

                210436_HfJK_3673274.png

    七、继续在settings.xml文件中配置mirror镜像

                211015_oFIP_3673274.png

    八、在eclipse中配置maven,配置Installations

                211106_QddE_3673274.png

                211128_CsKl_3673274.png

    九、配置User Settings

                211226_Cz8v_3673274.png

                211243_Cv8m_3673274.png

    十、创建maven项目

                211318_2F0L_3673274.png

                211347_5OSC_3673274.png

                211404_ddrY_3673274.png

                211421_JLx6_3673274.png

    十一、完成后、生成的maven项目的结构

                211501_YegI_3673274.png

    十二、由于项目没有生成java和test源文件目录,需要把项目的jre版本更改为下图:

                     211609_dTz1_3673274.png

    十三、最终一个完整的maven项目结构:

                    211645_5box_3673274.png

    转载于:https://my.oschina.net/u/3673274/blog/1528902

    展开全文
  • Maven配置步骤

    2020-05-13 11:54:58
    Maven配置步骤 1.阿里云的Maven仓库文件,地址:添加链接描述 2.阿里云镜像配置文件,setting.xml setting.xml文件实例 此处地址是个人maven存放路径 3.Eclipse配置setting.xml,引入Maven 第一步: Eclipce 中 ...

    Maven配置小步骤
    1.阿里云的Maven仓库文件,地址:添加链接描述
    2.阿里云镜像配置文件,setting.xml
    在这里插入图片描述
    setting.xml文件实例这里的地址是个人的maven存放路径
    此处的地址是个人maven存放的路径
    3.Eclipse配置setting.xml,引入Maven

    1. 第一步:
      Eclipce 中 点击 Widow —>Preferences
      找到Maven选项中的User Settings,在右侧的Global Settings选择settings.xml文件位置,点击Apply and Close
      在这里插入图片描述

    2. 配置确认
      在Eclipse中点击Window—>Show View—>Other
      在这里插入图片描述输入Maven(大小写不限输入即可),选择Maven Repositories,点击Open,选择Maven Repositories窗口打开,打开Global Repositories查看配置成功
      在这里插入图片描述

    展开全文
  • maven3.3.9个和maven在sts中的配置步骤Maven能够很方便的帮你管理项目报告,生成站点,管理JAR文件
  • 1.前面的配置和IDEA(IJ)中的配置一样 2.软件中的配置 1.点击Window->点击下面的Preferences 2.搜索Maven
  • maven 环境配置前言环境配置步骤本地...如上图配置MAVEN_HOME和M2_HOME,其内容是maven的安装路径(不要有中文!) 3、修改path添加maven相关路径 在path中配置jdk的环境变量后面加上两条:%MAVEN_HOME%\bin %M2_HOME
  • Maven配置步骤

    2019-08-28 14:22:16
    (1)官网下载 下载地址,下载好放到E盘(我习惯把软件放到E) (2)配置环境变量 a.配置新建M2_HOME E:\apache-maven-3.6.1 ...找到刚刚下载的maven文件,找到里面conf文件夹,E:\apache-maven-3.6.1\co...
  • 配置Maven环境的步骤

    2018-07-25 18:59:26
    --前提Maven已下载解压 1.在setting(apache-maven-3.5.3\conf中)文件中配置本地仓库:<localRepository>F:\03_mavenRepository...在setting文件中配置阿里云镜像:选一个好用, mirrorOf不要配置为*, 否则会影...
  • Maven 配置 文章目录 1.maven安装包 打开conf文件夹setting.xml文件 2.增加本地仓库地址 D:/jarstore 3.增加镜像库 ··· alimaven central aliyun maven https://maven.aliyun.com/repository/central aliyun...
  • 主要介绍了Maven setting配置镜像仓库方法步骤,小编觉得挺不错,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
  • maven的配置

    2018-02-10 17:43:07
    maven的配置,里面详细的讲述了配置的步骤,不懂得可以看看,大神勿喷
  • Maven3使用配置步骤

    2013-05-08 16:33:56
    Maven3使用配置步骤 1. 下载Maven 2. 安装Maven 3. 设置仓库位置 4. 创建maven项目 5. 编译项目代码 6. 导入eclipse工具 7. 包更新与下载
  • eclipse配置maven的步骤

    2018-11-17 14:06:13
    1、安装maven环境。解压apache-maven-3.0.5-bin.zip,并把目录配置到环境变量path中,如下图1.2
  • 2.找到Maven的下载目录的bin文件的路径 3.点击新建,把bin文件的路径放进去,然后点击确定就完成了。 (注意:前提一定要配好JDK) (注意:这是是windows 10系统) (注意:这是是windows 7系统)  直接...
  • Windows下 maven3.0.4的安装步骤+maven配置本地仓库  转自 ...简单讲下maven的安装步骤: 1.在安装maven之前,先确保已经安装JDK1.6及以上版本,并且配置好环境变量。 2.下载
  • 主要介绍了使用Maven配置Spring方法步骤,小编觉得挺不错,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
  • 主要介绍了maven国内镜像配置的方法步骤,文中通过示例代码介绍非常详细,对大家学习或者工作具有一定参考学习价值,需要朋友们下面随着小编来一起学习学习吧
  • MAVEN的安装和Myeclipse+maven的配置和使用步骤如下:maven的安装 下载maven 在https://maven.apache.org/download.cgi中下载apache-maven-3.3.9-bin.zip,直接解压到本地中。 配置环境变量 请确认好已经安装了jdk...
  • ideal 打开maven项目 的步骤1.配置svn2.配置maven3.配置sdk4.创建一个空项目创建完以后显示5.导入module进入项目空间,导入本地下载项目如果是maven项目 ,直接选择pom.xml就可以了.6.配置tomcat推荐:spring cloud...
  • Maven本地配置步骤Maven配置Maven配置IDEA配置Maven仓库 Maven配置 官网下载Maven后解压缩至非中文目录。 Maven配置 创建maven本地仓库文件夹 新创建一个maven本地仓库文件夹LocalWareHouse(名字可随便取) ...
  • eclipse配置maven环境详细步骤解读 下载压缩包,下载地址:http://maven.apache.org/download.cgi 下载apache-maven-3.6.1-bin.tar.gz 压缩文件夹到一个目录下 配置环境变量 鼠标移到此电脑,右键点击属性,点击高级...
  • 简单讲下maven的安装步骤: 1.在安装maven之前,先确保已经安装JDK1.6及以上版本,并且配置好环境变量。 2.下载maven3,最新版本是Maven3.0.4 ,下载地址:http://maven.apache.org/download.html 下载apache-ma...
  • maven的安装步骤

    2017-04-18 21:57:00
    maven的安装步骤 1> 下载最新的额maven的版本 在这我下载安装的是apache-maven-3.5.0,解压后显示为    2> 在window中配置环境变量和属性   接着在path中配置bin   3> 安装完成 在doc窗口验证...
  • 配置Maven的settings.xml: 1、本地存储库位置 E:/apache-maven-3.5.22、中央仓库使用阿里的比较快 alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central 3...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 5,231
精华内容 2,092
关键字:

maven的配置步骤