`
iuottp
  • 浏览: 169699 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

【原创】maven + nexus 的settings.xml配置实例

阅读更多

[原创]

1. settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<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">

  <pluginGroups/>
  <proxies/>
  <servers/>
  <mirrors/>

  <profiles>
    <profile> 
      <id>nexus</id> 
      <repositories> 
        <repository> 
            <id>nexus</id> 
            <name>local private nexus</name> 
            <url>http://localhost:8080/nexus/content/groups/public</url> 
            <releases><enabled>true</enabled></releases> 
            <snapshots><enabled>false</enabled></snapshots> 
        </repository> 
        <repository> 
            <id>nexus</id> 
            <name>local private nexus</name> 
            <url>http://localhost:8080/nexus/content/groups/public-snapshots</url> 
            <releases><enabled>false</enabled></releases> 
            <snapshots><enabled>true</enabled></snapshots> 
        </repository> 
      </repositories> 
      <pluginRepositories> 
        <pluginRepository> 
            <id>nexus</id> 
            <name>local private nexus</name> 
            <url>http://localhost:8080/nexus/content/groups/public</url> 
            <releases><enabled>true</enabled></releases> 
            <snapshots><enabled>false</enabled></snapshots> 
        </pluginRepository> 
        <pluginRepository> 
            <id>nexus</id> 
            <name>local private nexus</name> 
            <url>http://localhost:8080/nexus/content/groups/public-snapshots</url> 
            <releases><enabled>false</enabled></releases> 
            <snapshots><enabled>true</enabled></snapshots> 
        </pluginRepository> 
       </pluginRepositories> 
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>nexus</activeProfile> 
  </activeProfiles>

</settings>

 

 

2. 在使用IDE时需要更新indices ,在使用idea时需要修改 bin\idea.exe.vmoptions 增加以下内容:

   

-Dhttp.proxyHost=localhost
-Dhttp.proxyPort=8080
-Dhttp.nonProxyHosts=localhost

   否则无法在IDE中更新indices,总是报告找不到文件的错误。 eclipse中未进行尝试,有机会尝试后补充。

 

3. nexus的最佳实践推荐每一个项目自定义一个group便于管理。

分享到:
评论
1 楼 haohaoxuexi1311 2011-10-14  
settings.xml里面的配置,需要在Nexus里做对应的配置吗??

相关推荐

    阿里云镜像的mavensettings.xml配置文件直接替换使用

    3. **直接替换**:根据题目描述,你可以直接将下载的名为"阿里云镜像的mavensettings.xml配置文件直接替换使用"的文件替换现有的`$USER_HOME/.m2/settings.xml`。请注意,替换前请备份原有的`settings.xml`,...

    maven的settings.xml配置

    maven的settings.xml配置,提供maven包下载位置,刚刚maven仓库镜像仓库下载。 &lt;localRepository&gt;D:/develop/apache-maven-3.6.0/repository &lt;id&gt;alimaven &lt;name&gt;aliyun maven &lt;url&gt;...

    maven settings.xml配置文件的作用

    `settings.xml`是Maven构建工具的核心配置文件之一,它定义了Maven仓库的位置、镜像设置、本地仓库路径、用户特定的配置信息等。在Maven的工作流程中,`settings.xml`扮演着至关重要的角色,它使得Maven能够根据用户...

    maven的settings.xml文件

    `settings.xml`是Maven的核心配置文件之一,它位于用户的Maven配置目录下,通常在`~/.m2/`(对于Unix系统)或`%USERPROFILE%\\.m2\`(对于Windows系统)。这个文件包含了Maven运行时的个性化设置,包括本地仓库路径...

    Maven settings.xml配置理解

    Maven作为Java领域最流行的构建工具之一,它的核心配置文件`settings.xml`是理解Maven工作原理的关键。这篇博客文章“Maven settings.xml配置理解”深入探讨了这个主题,我们将在此详细阐述其主要内容。 `settings....

    maven镜像设置 settings.docx

    《Maven镜像设置详解——settings.xml配置指南》 在软件开发中,Maven作为Java项目管理和构建工具,起着至关重要的作用。然而,当访问远程仓库时,由于网络问题或者速度限制,可能会遇到下载依赖慢的问题。为了解决...

    国内开源中国镜像settings.xml配置

    标题中的“国内开源中国镜像settings.xml配置”指的是在开发环境中,为了加速访问国外的开源软件仓库,如Maven或Gradle,开发者通常会配置一个国内的开源镜像地址到`settings.xml`文件中。这个配置能有效提高依赖...

    Maven+配置文档.zip

    - **settings.xml**:位于用户主目录下的`.m2\settings.xml`文件,用于存储全局配置,如本地仓库路径、远程仓库设置、镜像配置等。 ### 3. Maven配置详解 #### 3.1 pom.xml配置 - **基本配置**:包括groupId、...

    Maven与Nexus配置.pdf

    具体到settings.xml的配置中,首先要定义一个镜像(mirror),将所有仓库镜像指向本地的Nexus服务地址,然后配置仓库列表(repositories)和插件仓库列表(pluginRepositories),这些仓库的具体行为(如是否启用...

    maven私服(nexus)配置(setting,pom.xml)

    本文将详细介绍如何配置Maven以使用Nexus作为本地中央仓库,以及涉及的主要配置文件`settings.xml`和`pom.xml`。 **一、Nexus简介** Nexus是Sonatype公司提供的一款开源的Maven仓库管理器,它能够作为Maven的代理...

    flink的pom和settings.xml设置

    `pom.xml`管理项目依赖和构建过程,而`settings.xml`则提供Maven的个人配置。正确配置这两个文件,将确保你的Flink项目能顺利构建、运行和部署。在实际开发中,应根据具体需求和环境对这两个文件进行适当的调整。

    maven+nexus完整手册

    为了使 Maven 使用 Nexus 作为依赖源,需要修改 Maven 的配置文件 `settings.xml`。以下是一个示例配置: ```xml &lt;id&gt;nexus &lt;id&gt;nexus &lt;name&gt;local-private-nexus &lt;url&gt;...

    nexus 2.x 安装配置指南

    1. **配置settings.xml**:开发人员需要在本地Maven配置文件(settings.xml)中指定Nexus作为私服仓库。 ![配置settings.xml](#图6-1.1.配置settings.xml) ##### 版本发布人员 1. **配置settings.xml**:版本...

    apache maven 3.5.0 已配置阿里源镜像

    这个文件位于用户的Maven配置目录下,如`~/.maven/settings.xml`。在`mirrors`标签下添加新的镜像配置,指定阿里源为主仓库或备用仓库。这样,Maven在下载依赖时会优先尝试阿里云的镜像服务器。 以下是可能的`...

    maven+j2ee+nexus的搭建

    搭建Nexus的过程包括安装Nexus服务器,配置Maven的settings.xml文件以指向Nexus的仓库地址,以及管理Nexus的仓库配置,如创建不同的存储库组和存储库类型。 "Maven2+Eclipse开发J2EE.pdf"这份文档可能详细介绍了...

    maven.aliyun.com·settings.xml.zip

    最新2019年9月中旬阿里云maven仓库,下载之后直接替换maven-3.6.x/conf/settings.xml即可,找了好多阿里云的仓库都是maven.aliyun.com/nexus/content/groups/public,死活用不成,pom一直报错,弄了一个星期差点崩溃...

    maven3+nexus2搭建本地,私有仓库

    为了让 Maven 使用 Nexus2 私有仓库,需要在 settings.xml 文件中添加镜像和 profile 配置。以下是配置步骤: 1. 添加镜像配置,指定 Nexus2 私有仓库的 URL 2. 添加 profile 配置,指定 releases 和 snapshots ...

    maven_第二部分源码(maven+nexus)

    1. **settings.xml** - Maven的全局或用户特定配置文件,包含仓库地址、镜像设置、代理服务器和本地仓库路径等信息。开发者可以在此定制Maven的行为,比如指定使用哪个Nexus仓库。 2. **user-core、user-dao、user-...

    settings.xml

    maven阿里云镜像配置xml &lt;id&gt;alimaven &lt;name&gt;aliyun maven &lt;url&gt;http://maven.aliyun.com/nexus/content/groups/public/&lt;/url&gt; &lt;mirrorOf&gt;central&lt;/mirrorOf&gt; 本地仓库记得配置

Global site tag (gtag.js) - Google Analytics