精华内容
下载资源
问答
  • IDEA配置maven教程

    2020-04-05 17:27:52
    步骤一:配置maven使用jdk编译的版本 步骤二:配置IDEA 2.1 打开IDEA的settings设置 2.2 找到Maven配置,把IDEA自带的maven改成自己安装的maven即可 步骤一:配置maven使用jdk编译的版本 给maven 的settings....

    目录

     

    步骤一:配置maven使用jdk编译的版本

    步骤二:配置IDEA

    2.1 打开IDEA的settings设置

    2.2 找到Maven配置,把IDEA自带的maven改成自己安装的maven即可


    步骤一:配置maven使用jdk编译的版本

    给maven 的settings.xml配置文件的profiles标签添加以下配置

    此配置为全局配置,使用maven创建的每个工程默认都是使用该jdk版本,可以解决每次创建maven项目jdk版本与本地jdk版本不一致的问题

        <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>

    如果你不想全局配置,可以在每个maven工程的pom.xml文件中添加maven插件也可达到同样的效果,只是每次创建工程都需要加上,不推荐这样做

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    步骤二:配置IDEA

    2.1 打开IDEA的settings设置

    2.2 找到Maven配置,把IDEA自带的maven改成自己安装的maven即可

    • 修改maven仓库的位置方法:打开maven安装目录下的settings.xml文件,按照下面修改即可

     

     

    展开全文
  • idea配置maven教程

    千次阅读 2018-10-20 13:57:39
    1.官网下载maven到本地,我的安装目录为:D:\softManager\install\maven-3.5.4\apache-maven-3.5.4 2.在\apache-maven-3.5.4新建文件夹:local_resposity 3.在安装目录下的conf下打开setting.xml:设置如下: &...

    1.官网下载maven到本地,我的安装目录为:D:\softManager\install\maven-3.5.4\apache-maven-3.5.4

    2.在\apache-maven-3.5.4新建文件夹:local_resposity

    3.在安装目录下的conf下打开setting.xml:设置如下:

    <localRepository>D:\softManager\install\maven-3.5.4\apache-maven-3.5.4\local_resposity</localRepository>设置maven下载jia包 的存放地址

    <mirror>
            <id>nexus-aliyun</id>
            <mirrorOf>central</mirrorOf>
            <name>Nexus aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror>

    将国外的maven下载源换位国内aliyun镜像源,速度快100倍 

    3.idea中配置maven:

    关闭项目,到开始页面,点击confiure,全局配置:

     至此配置完毕。

    修改

    SprintbootApplication中的代码:
    @SpringBootApplication
    @RestController
    public class SprintbootApplication {
    
        @RequestMapping("/helloboot")
        public String hello(){
            System.out.println("print hello to web page");
            return "hello spring boot";
        }
        public static void main(String[] args) {
            SpringApplication.run(SprintbootApplication.class, args);
        }
    }

    浏览器输入localhost:8080/helloboot可看到:

    maven将jar包添加到本地仓库中

    mvn install:install-file -DgroupId=javax.annotation -DartifactId=javax.annotation-api -Dversion=1.3.2 -Dpackaging=jar -Dfile=javax.annotation-api-1.3.2.jar

    参考:

    https://blog.csdn.net/qq_35462323/article/details/84863470

    展开全文
  • 使用IntelliJ IDEA 配置MavenIntelliJ IDEA介绍Maven介绍IntelliJ IDEA整合MavenIntelliJ IDEA下载及安装Maven下载教程IntelliJ IDEA配置Maven IntelliJ IDEA介绍 IDEA 全称IntelliJ IDEA,是用于java语言开发的集成...

    IntelliJ IDEA介绍

    IDEA 全称IntelliJ IDEA,是用于java语言开发的集成环境(也可用于其他语言),IntelliJ在业界被公认为最好的java开发工具之一,尤其在智能代码助手、代码自动提示、重构、J2EE支持、Ant、JUnit、CVS整合、代码审查、 创新的GUI设计等方面的功能可以说是超常的。IDEA是JetBrains公司的产品,这家公司总部位于捷克共和国的首都布拉格,开发人员以严谨著称的东欧程序员为主。

    Maven介绍

    Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的项目管理工具软件。
    Maven 除了以程序构建能力为特色之外,还提供高级项目管理工具。由于 Maven 的缺省构建规则有较高的可重用性,所以常常用两三行 Maven 构建脚本就可以构建简单的项目。由于 Maven 的面向项目的方法,许多 Apache Jakarta 项目发文时使用 Maven,而且公司项目采用 Maven 的比例在持续增长。

    IntelliJ IDEA整合Maven

    IntelliJ IDEA下载及安装

    1. 首先从官网下载IntelliJ IDEA
      IntelliJ IDEA官网
    2. 点击Download进入下载页,操作如下图
      下载IntelliJ IDEA
    3. 下载完成后安装即可,本文不再赘述
      IntelliJ IDEA安装文件安装教程

    Maven下载教程

    1. Mavne官网
      mavne官网
    2. 下载指定版本的Maven压缩包,下载后解压到指定位置即可
      下载maven
    3. Maven配置阿里云远程仓库
      点击教程,本文不再重点说明,settting中阿里仓库的配置。
    <mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>        
    </mirror>
    

    IntelliJ IDEA配置Maven

    1. 在IDEA中打开File-settings如下
      配置maven
    2. 验证配置效果
      在IDEA中选择File->Project…
      创建maven项目
      点击next
      创建maven项目
      在这里插入图片描述
      点击完成,项目创建成功
      在maven项目创建完成
    展开全文
  • 配置本地仓库Repository 3.IDEA配置Maven 三点。 相关博客: Eclipse配置Mavenhttps://www.cnblogs.com/hero123/p/9076260.html ItelliJ IDEA下载及获取注册码详解https://www.cnblogs.com/hero123/p/909217...

    本文章主要介绍1.Maven下载   2.配置本地仓库Repository   3.IDEA配置Maven 三点。

     

    相关博客:

    Eclipse配置Maven https://www.cnblogs.com/hero123/p/9076260.html

    ItelliJ IDEA下载及获取注册码详解 https://www.cnblogs.com/hero123/p/9092178.html

    IntelliJ IDEA创建Maven+SSM+Tomcat+Git项目【全程详解】https://www.cnblogs.com/hero123/p/9092576.html

     

    首先下载Maven  :

    Maven官网下载地址:http://maven.apache.org/download.cgi ,下载后解压: 

     

    其次配置Maven中的setting 文件:

    1/找到刚才解压Maven文件,然后找到/conf/settings.xml

     

     

    2/修改配置文件中的本地仓库路径,和远程仓库路径(我配置的是阿里镜像仓库,jar包下载速度快)

     

    <?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>E:/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.
       |-->
      <mirrors>
        <!-- mirror
         | 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>
         -->
         <!--<mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            //<mirrorOf>central</mirrorOf> 
            <mirrorOf>*</mirrorOf>
        </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.
       |
       |-->
      <profiles>
        <!-- 
        <id>jdk17</id>  
        <activation>  
            <activeByDefault>true</activeByDefault>  
            <jdk>1.7</jdk>  
        </activation>  
        <properties>  
            <maven.compiler.source>1.7</maven.compiler.source>  
            <maven.compiler.target>1.7</maven.compiler.target>  
            <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>  
        </properties>  --> 
        <!-- profile
         | 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>
    
      <!-- activeProfiles
       | List of profiles that are active for all builds.
       |
      <activeProfiles>
        <activeProfile>alwaysActiveProfile</activeProfile>
        <activeProfile>anotherAlwaysActiveProfile</activeProfile>
      </activeProfiles>
      -->
    </settings>
    View Code

    其中两个位置需要注意:本地仓库路径(你生成自己的仓库地址,注意路径时/ ,不是\ )和阿里云maven镜像配置(此处我注了,你可以放开)

     

     

    然后在IDEA中配置Maven:

    打开IDEA,点击右上角File --> Setting .

    配置好后,点击Apply,--> OK  应用即可。

     

    转载于:https://www.cnblogs.com/hero123/p/9092581.html

    展开全文
  • maven介绍maven是apache组织开发的一款开源的可以管理JavaWeb...POM介绍POM(Project Object Model 项目对象模型),是一个maven的核心配置文件(xml格式)。用于描述项目如何构建,声明项目依赖,打包运行的方式等等。...
  • IDEA配置maven详细教程

    2021-04-08 08:38:54
    一、maven下载 ... 下载后解压到相应的路径 二、环境变量配置 此电脑→属性→高级系统设置→环境...三、IDEA配置maven 第一步:配置maven本地仓库 第二步:修改依赖下载地址 mirrors 第三步:修...
  • idea配置maven

    2019-01-28 17:06:29
    idea配置maven教程 解决方法: 1.下载:http://maven.apache.org/download.cgi 我下载的是window版本apache-maven-3.5.4-bin.zip,解压到F:/jianzhi,并在F:/jianzhi目录新建localRepository本地仓库。 修改F:\...
  • IDEA配置Maven IDEA配置Maven前,首先你本机要安装好Maven环境,然后我们的IDEA才能关联到本机的Maven 具体配置如下: File-settings-Maven 以上步骤就完成了IDE对Maven的配置,下面介绍如何用IDEA创建...
  • IDEA配置Maven教程

    2020-11-30 17:44:12
    配置conf文件中的setting.xml(用文本编辑器打开推荐nodepad++) 打开文件找到localRepository标签 插入自己Maven\bin的文件地址 <!-- localRepository | The path to the local repository maven will use to ...
  • IDEA配置MAVEN

    2018-06-15 11:56:25
    IDEA配置MAVEN说明:本教程为IDEA创建MAVEN项目之前配置工作 1.在IntelliJ IDEA中配置maven打开IDEA---&gt;File---&gt;Settings 配置 完成上述配置
  • 主要为大家详细介绍了使用IDEA配置Maven搭建开发框架ssm教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
  • 而需要使用Maven的命令,所以需要配置Maven的环境变量。Maven本身使用Java开发,也依赖JDK的环境变量。 1.1JDK环境变量配置 配置:JAVA_HOME 配置classpath 配置path 1.2Maven的目录结构介绍 1.3配置Maven环境.....
  • 主要介绍了IDEA配置maven环境的详细教程(Unable to import maven project问题的解决),本文通过图文并茂的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
  • 使用IDEA配置Maven搭建开发框架ssm教程一、配置Maven环境1.下载Maven:下载链接2.下载完成解压压缩包并创建本地仓库文件夹3.打开解压缩文件,配置本地仓库路径4.配置Maven环境变量5.在cmd中查看maven是否配置正确在...
  • IDEA配置MAVEN_OPTS

    2020-05-29 14:16:23
    IDEA配置MAVEN_OPTS1.未配置之前2.优化配置3.开启多线程 解决问题 maven MAVEN_OPTS设置 maven编译优化 maven编译速度慢 maven打包编译很慢 maven多线程编译打包 IDEA Maven配置教程 测试环境:Win10(64位) + i7-...
  • 1.下载Maven ... (由于tomcat和我的mybatis...3.配置maven环境变量 找到此电脑,右击属性,进入如下界面 点击高级系统设置 点击高级–>环境变量 在系统变量中点击新建环境变量,新建M2_HOME,再将Maven解压路径填入变
  • IDEA配置maven

    2021-01-15 11:46:23
    从接触项目开发,跑后端用的都是idea,原来的时候不知道是不是科学上网的原因,idea下载maven的依赖从来就没顺利过,都是上网到处找教程,找解决办法。这次闲下来打算彻底解决一下这个问题。 1. idea版本 使用过...
  • 教程记录了我在一台新的电脑上安装IDEA配置JAVA+MAVEN+GIT+SpringBoot项目的过程,最终完成了项目的运行。一、若想利用IDEA的git工具从GitHub或者码云上面获取项目,需要提前下载git软件,并完成初步的配置。1. ...
  • 一、配置maven环境1.下载maven下载链接2....在cmd中查看maven是否配置正确在cmd中输入mvn -v命令查看二、在intellij idea配置maven打开-file-settings三、新建maven javaweb项目1.打开-file-new-projectnextnex...
  • 1.配置Maven 1)打开IDEA:File–>Settings, *注意Settings.xml文件配置: 仓库地址:python<localRepository>D:\software\repository</localRepository> 阿里云镜像: <mirror> <id>...
  • 3.配置MAVEN_HOME maven 的使用是在jdk的基础上,所以电脑必须有jdk 第一步:新增环境变量:MAVEN_HOME 第二步:在path环境变量中添加:%MAVEN_HOME%\bin 找到环境变量配置界面 第三步:测试:按住win+R 输入...
  • windows IDEA 配置maven

    2016-10-30 09:43:50
    1. 安装配置Maven  配置教程请点击链接 新建工程
  • IDEA配置Maven图解

    2019-11-05 14:23:47
    Maven的下载与安装配置教程:https://blog.csdn.net/xiangwei_m/article/details/102911454 找到IDEA设置:File-->Settings 然后找到Build, Execution, Deployment,打开Build Tools选项,选择Maven,...

空空如也

空空如也

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

idea配置maven教程