Maven Config

Repository

Both use public and private

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<settings>
<servers>
<server>
<id>sync-releases</id>
<username>sync</username>
<password>sync</password>
</server>
</servers>
<mirrors>
<mirror>
<id>central</id>
<name>Central</name>
<url>https://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>develop</id>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>sync-releases</id>
<name>Releases</name>
<url>http://localhost/repository/maven-releases/</url>
</repository>
</repositories>
</profile>
</profiles>

<activeProfiles>
<activeProfile>develop</activeProfile>
</activeProfiles>

</settings>

https://maven.apache.org/guides/mini/guide-mirror-settings.html


Error

Deployment failed: repository element was not specified in the POM inside distributionManagement

缺少 distributionManagement 配置信息

1
2
3
4
5
6
7
8
9
10
11
12
<distributionManagement>
<repository>
<id>releases</id>
<name>Releases</name>
<url>http://maven.example.com/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshot</name>
<url>http://maven.example.com/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>

Solution:https://my.oschina.net/wjzk/blog/602372

xxx was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<profiles>
<profile>
<id>develop</id>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>sync-releases</id>
<name>Releases</name>
<url>http://localhost/repository/maven-releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
</profile>
</profiles>