maven项目穿件.m2文件夹

创建为.m2.,m2前后都要有点,然后去掉后面的点

settings.xml文件如下:

<?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>C:\Users\ceshi3\.m2\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>localRepository</id>
    <name>localRepository</name>
    <url>http://10.*.*.100:8081/nexus/content/groups/public/</url>
    <mirrorOf>central</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>
    <!-- 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>localRepository</id>
        <repositories>
            <repository>
                <id>Pulbic Repositories</id>
                <name>Pulbic Repositories</name>
                <url>http://10.*.*.100:8081/nexus/content/groups/public/</url>
            </repository>
            <repository>
                <id>3rd Party</id>
                <name>3rd Party</name>
                <url>http://10.*。*.100:8081/nexus/content/repositories/thirdparty/</url>
            </repository>
            <repository>
                <id>Central</id>
                <name>Central</name>
                <url>http://10.*.*.100:8081/nexus/content/repositories/central/</url>
            </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>localRepository</activeProfile>
   <!-- <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>-->
  </activeProfiles>
</settings>

原文地址:https://www.cnblogs.com/gcgc/p/10929835.html

时间: 2024-10-11 08:32:24

maven项目穿件.m2文件夹的相关文章

Linux环境下Maven的.m2文件夹

aven中的.m2文件夹 安装完maven是没有.m2文件夹的.在linux中以.开头的文件夹都是隐藏的.当使用maven命令的时候,maven自动会创建.m2文件夹. 运行命令mvn help:system,查看java系统属性和环境变量. 会去下载一些maven相关的文件,.m2这会才生成 repository 所有的maven构件,都存储在repository中.比如本机中的使用maven的项目所以来的jar包,下载后都会存放在此处. 然后上传我们自己配置setting文件即可. 原文地址

Maven .m2文件夹创建

settings.xml存在于两个地方: 1.安装的地方:$M2_HOME/conf/settings.xml 2.用户的目录:${user.home}/.m2/settings.xml 前者又被叫做全局配置,后者被称为用户配置.如果两者都存在,它们的内容将被合并,并且用户范围的settings.xml优先. 如果你偶尔需要创建用户范围的settings,你可以简单的copy Maven安装路径下的settings到目录${user.home}/.m2.Maven默认的settings.xml是

maven本地仓库.m2文件夹路径讲解

Maven是一个项目管理工具,它包含了一个项目对象模型 (Project Object Model),一组标准集合,一个项目生命周期(Project Lifecycle),一个依赖管理系统(Dependency Management System),和用来运行定义在生命周期阶段(phase)中插件(plugin)目标(goal)的逻辑.当你使用Maven的时候,你用一个明确定义的项目对象模型来描述你的项目,然后Maven可以应用横切的逻辑,这些逻辑来自一组共享的(或者自定义的)插件. 基本的常用

eclipse如何把多个项目用不同的文件夹分隔开

我们有时候用eclipse时,发现Project Explorer下有非常多的项目,如果大部分不用了还好,我们可以从eclipse上删掉,但是如果还经常会用到的话,删掉了,每次用的时候,还得再重新导入,非常的麻烦,但如果不删的话,就显得非常杂乱,找的也费劲,所以我们就可以把不同的项目用不同的文件夹分开. 首先看到我的eclipse里,有这些项目,两个maven项目就有八个工程,看得很杂乱. 首先我们点击上面的倒三角 里面有一个Top Level Elements选项 点击后,出现这三个选项,系统

windows 自动移动maven jar包到jmeter 文件夹下面

jmeter 自动移动maven jar包到jmeter 文件夹下面 bat 文件 rem 本文件放在jmeter 脚本maven项目根目录下面,和pom.xml在同一个文件夹下面 rem 预置条件,把官网下载的apache-jmeter-3.2.zip 放在如下filePath 并解压到当前文件夹 set filePath=D:\work\jmeterPerformanceTest rem rd /s /q %filePath%\apache-jmeter-3.2\ rem echo "sta

C#项目,在controller文件夹右击鼠标没有“添加控制器”的问题

1.发现拷贝的项目,在controller文件夹右击鼠标不能没有“添加控制器”这一项,在控制器里面右键控制器名称也没有“添加视图”,这样就控制器和视图都要手写,开发效率低 . 2.原因是mvc包的问题,解决方法为:先卸载mvc包,再安装一次,再重启vs. 具体步骤: 1)在自己的web项目的“引用”上操作,如下图的“引用”,右击,点击”管理NuGet程序包“. 2)在弹出的如下界面,找到该项,点击“卸载”. 3)卸载完之后就安装这个. 4)一般的情况下,以上的步骤就可以完成了,重启一下项目后,问

Android ADT,SDK 更新后一个问题:新建项目layout和src文件夹为空

Android SDK和ADT更新到23.0.0后,结果问题出现了,在创建一个默认的blank activity后,发现layout和src文件夹为空,没有默认的框架文件,原来以为是安装出问题,删除重装,还是没有办法解决.今天发现两个文件又有更新包了,不知道是不是Android SDK的23.0.0版本和ADT的23.0.0版本本身导致的问题,不过更新到23.0.1后解决问题了. 解决方案: 步骤一:启动SDK Manager,按照提示把Android SDK tools更新至最新版本23.0.

项目中出现paxheader文件夹,里面的文件名称是乱码,是不是病毒?

最近从SVN上Check下来的一个项目中包含paxheader文件夹,里面的文件名称是乱码,是不是病毒呢? 经过网上一番搜索,结合公司有人使用Linux系统的情况,总结可能的原因是代码之前是在Linux系统下写的,可能是在Linux系统下打成tar.gz包发到Windows系统下然后解压出来 的,由于tar.gz的一些特性Windows下的解压软件支持的不好,所以才形成了paxheader文件夹. 参考: http://lists.freebsd.org/pipermail/freebsd-cu

[原]Maven项目编译后classes文件中没有.xml问题

在做spring+mybatiss时,自动扫描都配置正确了,却在运行时出现了如下错误.后来查看target/classes/.../dao/文件夹下,发现只有mapper的class文件,而没有xml文件,将对应的xml文件放到这个文件夹下运行就不会出现下面的错误.说明出现这个错误的原因是maven编译时没有将xml文件放进去. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com