精华内容
下载资源
问答
  • Maven setting配置文件

    万次阅读 多人点赞 2018-05-27 00:33:31
    修改maven配置文件 <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8...


    Maven setting配置镜像仓库

    配置本地仓库

       1 <!--自定义本地仓库路径-->

      2 <localRepository>E:\JAVA\Maven</localRepository>

    国内Maven镜像仓库

    <mirror>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>alimaven</id>
        <mirrorOf>central</mirrorOf>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
    </mirror>
    
    <mirror>
        <id>ibiblio</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
    </mirror>
    <mirror>
        <id>jboss-public-repository-group</id>
        <mirrorOf>central</mirrorOf>
        <name>JBoss Public Repository Group</name>
        <url>http://repository.jboss.org/nexus/content/groups/public</url>
    </mirror>
    
    <mirror>
        <id>central</id>
        <name>Maven Repository Switchboard</name>
        <url>http://repo1.maven.org/maven2/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>repo2</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://repo2.maven.org/maven2/</url>
    </mirror>


    maven项目编译jdk版本更改

    首先要下载
    maven-compiler-plugin   jar包

    通过maven-compiler-plugin  jar包指定JDK版本和编码

    方法1

    在maven项目的pom.xml中加入一下代码
        <build>  
                <plugins>  
                    <plugin>  
                        <groupId>org.apache.maven.plugins</groupId>  
                        <artifactId>maven-compiler-plugin</artifactId>  
                        <version>2.1</version>  
                        <configuration>  
                            <source>1.7</source>  
                            <target>1.7</target>  
                        </configuration>  
                    </plugin>  
                </plugins>  
            </build>  


    然后重新update maven就可以解决该问题

    方法2

    修改maven配置文件

        <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选项add plugin

    搜索compiler  选最新的

    然后强制更新项目

    完整setting配置


    1. 本地仓库路径由 .m2/repository 更改到E:\java\maven

    2.增加国内镜像仓库2个

    3.maven 编译器版本更改为javaSE-1.8

    <?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.home}/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>E:\JAVA\Maven</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-central</id>
                <mirrorOf>central</mirrorOf>
                <name>aliyun maven</name>
                <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
            </mirror>
            <mirror>
                <id>jboss-public-repository-group</id>
                <mirrorOf>central</mirrorOf>
                <name>JBoss Public Repository Group</name>
                <url>http://repository.jboss.org/nexus/content/groups/public</url>
            </mirror>
    
            <!--<mirror>
                <id>alimaven</id>
                <name>aliyun maven</name>
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                <mirrorOf>central</mirrorOf>
            </mirror>
    
            <mirror>
                <id>ibiblio</id>
                <mirrorOf>central</mirrorOf>
                <name>Human Readable Name for this Mirror.</name>
                <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
            </mirror>
    
            <mirror>
                <id>central</id>
                <name>Maven Repository Switchboard</name>
                <url>http://repo1.maven.org/maven2/</url>
                <mirrorOf>central</mirrorOf>
            </mirror>
            <mirror>
                <id>repo2</id>
                <mirrorOf>central</mirrorOf>
                <name>Human Readable Name for this Mirror.</name>
                <url>http://repo2.maven.org/maven2/</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.
         |
         |-->
        <profiles>
            <!-- 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>
            -->
            <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>
    
            <!--
             | 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>
    
    


    展开全文
  • setting.xml配置文件

    千次阅读 2018-09-26 15:03:13
  • Maven之(六)setting.xml配置文件详解

    万次阅读 多人点赞 2016-05-24 09:51:24
    鉴于CSDN对**版权保护的不作为**以及落后的运营手段,本博客将于近期关闭,并清空全部文章。 原有文章将会经过再次的校对、整理,转移至本人在**简书**的[博客空间](https://www.jianshu.com/u/3ec23ef9a408... ...


    鉴于CSDN对**版权保护的不作为**以及落后的运营手段,本博客将于近期关闭,并清空全部文章。

    原有文章将会经过再次的校对、整理,转移至本人在**简书**的[博客空间](https://www.jianshu.com/u/3ec23ef9a408)。

     

    展开全文
  • IDEA 修改 Maven 的setting配置文件指向

    千次阅读 2019-08-31 17:53:41
    使用IDEA的时候换一下 Maven的setting文件的指向。 这个需求就是,你本来使用自己...做法就是复制一份setting配置文件,找打你的maven然后存放一份复制的setting文件,然后再在IDEA里边改变一下配置文件的指向: ...

    使用IDEA的时候 换一下 Maven 的 setting 文件的指向。

     这个需求就是,你本来使用自己的文件Maven仓库,然后连着阿里云。

     现在到了公司需要用公司的私服

     

     做法就是 复制一份 setting配置文件,找打你的maven 然后存放一份复制的setting文件,然后再在IDEA里边改变一下配置文件的指向:

    展开全文
  • Maven项目的setting配置文件

    千次阅读 2019-06-18 09:49:15
    --配置本地仓库--> <localRepository>D:/m2/repository</localRepository> 2.配置阿里云镜像 <mirrors> <mirror> <!--This sends everything else to /public -->...
  • setting文件配置

    千次阅读 2010-08-10 17:28:00
    简介settings.xml文件中的settings元素包含了很多子元素,它们定义的值被用来配置Maven的执行情况。该settings文件的设置会被应用到很多个项目上,因此这里的设置不应该和任何一个特定的项目绑定,并且该设置的内容...
  • Maven项目setting.xml配置文件详解

    万次阅读 2018-01-04 09:34:41
    能看懂英文当然更好,地址:配置文件官方说明https://maven.apache.org/settings.htmlMaven项目的setting.xml文件,主要分为两个: 用户的安装: ${user.home}/.m2/settings.xml 当前用户范围的配置文件; Maven...
  • MAVEN配置文件setting.xml的配置

    千次阅读 2019-05-21 14:28:12
    Maven作为项目管理工具目前已经在很多公司使用,特备是有很多大型项目上更是需要自己搭建内网私服来对项目进行单独管理,在此就几种情况下maven的setting文件配置作以区分,以备后期使用,想了解每个配置项的具体...
  • vscode 配置文件setting

    千次阅读 2019-10-12 10:14:41
    { "dart.flutterSdkPath": "C:\\Users\\EDZ\\Flutter\\flutter", "prettier.useTabs": true, "vetur.format.defaultFormatter.html": "js-beautify-html", // "vetur.format.defaultFormatter.js": ...
  • VSCode默认setting.json配置文件

    千次阅读 2020-01-13 10:23:25
    配置了Vue Eslint的自动保存,setting.json直接复制粘贴即可 { "editor.tabSize": 2, "files.associations": { "*.vue": "vue" }, "eslint.options": { "extensions": [ ".js", ...
  • maven的setting.xml配置文件详解

    千次阅读 2017-02-20 10:12:14
    setting.xml配置文件 maven的配置文件settings.xml存在于两个地方: 1.安装的地方:${M2_HOME}/conf/settings.xml 2.用户的目录:${user.home}/.m2/settings.xml 前者又被叫做全局配置,对操作系统...
  • maven 3.6.1 setting.xml配置文件

    千次阅读 2020-03-20 00:29:55
    不知道为什么maven setting.xml突然被清空了, 所以特地储存一下, 下次再出现情况也好应对 注意配置镜像和本地仓库信息就可以: 我这里的镜像是阿里云 我这里的本地仓库:E:\maven\apache-maven-3.6.1 <?xml ...
  • maven配置setting.xml文件,使用阿里云下载地址

    万次阅读 多人点赞 2018-06-28 10:57:52
    | maven will use a sensible default value, perhaps based on some other setting, for | the parameter in question. | | Default: true <interactiveMode>true --> <!-- offline | Determines ...
  • maven配置setting.xml文件、POM.xml详解

    万次阅读 2014-09-23 14:41:27
    1 maven配置setting.xml文件 2
  • 在eclipse中如果你的项目是一个maven项目,那么配置maven仓库是一个很基本的事情,maven要求配置setting文件,用来表示本地仓库中位置,以及远程仓库路径,不过这个配置只能在从服务器上下载相关依赖的时候起到作用...
  • 这个时候如果mavensetting.xml中配置了镜像 , 而且镜像配置的规则中匹配到目标仓库时 , maven认为目标仓库被镜像了, 不会再去被镜像仓库下载依赖jar包, 而是直接去镜像仓库下载. 简单而言, mirror可以拦截对远程...
  • Maven 配置文件 setting.xml 的读取顺序

    千次阅读 2018-06-11 15:08:36
    在 Windows 系统下,打开终端工具,运行 mvn 命令时, setting 配置文件的读取规则:1、优先从 ${user}\.m2 目录下读取 setting.xml2、当 ${user}\.m2 目录下不存在 setting.xml 时,从 ${M2_HOME}\conf 目录下...
  • setting.xml配置文件 maven的配置文件settings.xml存在于两个地方: 1.安装的地方:${M2_HOME}/conf/settings.xml 2.用户的目录:${user.home}/.m2/settings.xml 前者又被叫做全局配置,对操作系统的所有使用者...
  • eclipse sts插件创建spring start project springboot项目 setting.xml配置文件 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;settings&gt; &lt;localRepository&...
  • maven在setting配置文件中指定jdk版本——以jdk1.8为例 1.打开setting.xml 目录一般在这里: C:\Program Files\apache-maven-3.5.4\conf 2.使用Ctrl+F搜索jdk 找到这些文件: <profile> <id>jdk-1.4...
  • 使用快捷键 Ctrl+Shift+P ,然后搜索setting 首选项:打开设置(json)这个打开的是settings.json文件 首选项:打开默认设置(json),这个打开的是defaultSettings.json文件 首选项:打开工作区设置,这个打开的是...
  • 读取scrapy配置文件setting.py中的方法

    千次阅读 2019-02-18 12:50:48
    from scrapy.utils.project import get_project_settings settings = get_project_settings() user_agents = settings['USER_AGENTS']  

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 224,946
精华内容 89,978
关键字:

下载setting无配置文件