ITeye博客

无法下载maven私库中项目的问题

lfwer · 2018-11-09 11:18 · maven · 编程语言 · Markdown

最近着手将项目拆分为了多个子项目,首先建立了一个父项目用于管理所有maven依赖包,接着做了两个工具jar,再就是几个业务项目。父项目和工具jar都上传到了公司私库,后来其他同事反应无法下载。通过调试发现,需要在业务项目中配置私库才能下载。

 

父项目中配置私库

<distributionManagement>
        <repository>
            <id>g7-release</id>
            <url>http://xx.com/artifactory/libs-release-local</url>
        </repository>
        <snapshotRepository>
            <id>g7-snapshots</id>
            <url>http://xx.com/artifactory/libs-snapshot-local</url>
        </snapshotRepository>
    </distributionManagement>

 

工具jar和业务项目配置私库

<repositories>
        <repository>
            <id>g7-central</id>
            <url>http://xx.com/artifactory/libs-release</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

 

如果要执行deploy,需要在setting.xml中配置你的私库账号

<server>
		<id>g7-release</id>
		<username>liufangwei</username>
		<password>xx</password>
	  </server>
	  <server>
		<id>g7-snapshots</id>
		<username>liufangwei</username>
		<password>xx</password>
	  </server>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。