在我的公司,我们使用Nexus服务器来获取工件。这很好。但有时我也想在家里使用Maven,我无法访问Nexus公司。有没有简单的方法来交换Maven设置配置文件?是否可以用m2eclipse
轻松交换?如何轻松地交换Maven设置配置文件?
目前我使用下面的settings.xml:
<settings
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>central</id>
<username>company-user</username>
<password>company-user</password>
</server>
<server>
<id>mirror</id>
<username>company-user</username>
<password>company-user</password>
</server>
</servers>
<mirrors>
<mirror>
<id>mirror</id>
<url>https://url.to.company.nexus</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>defaultprofile</id>
<repositories>
<repository>
<id>central</id>
<name>Repository for Company artifacts</name>
<url>https://url.to.company.nexus</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Repository for Company artifacts</name>
<url>https://url.to.company.nexus</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
<activeProfiles>
<activeProfile>defaultprofile</activeProfile>
</activeProfiles>
</settings>
我知道我可能会到一个新的配置文件添加到http://repo1.maven.org/
,但如何确保现有mirrors
不会抱怨超时?
这不是一个真正的解决方案,因为大多数情况下我需要下载一些东西...... – asgoth