nexus3中央倉庫改為阿裡雲
參考:這裡寫連結内容
找到中央倉庫

然後修改成:
idea使用私服maven及對應配置
參考:
這裡寫連結内容
首先,建立一個maven項目—自己建立吧。
然後,
看到本機的maven 配置檔案,
打開來,然後:
添加我們的maven私服及servers—用來釋出類庫的。
格式如下:
<?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">
<mirrors>
<!--内部maven-->
<mirror>
<id>central</id>
<mirrorOf>*</mirrorOf>
<name>Central Repository</name>
<url>http://你倉庫的位址/repository/maven-public/</url>
</mirror>
<!-- 阿裡雲倉庫 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<!-- 中央倉庫1 -->
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<!-- 中央倉庫2 -->
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
</mirrors>
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>你的密碼</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>你的密碼</password>
</server>
</servers>
</settings>
釋出快照及正式版本
maven(15),快照與釋出,RELEASE與SNAPSHOT
在pom.xml檔案最後添加distributionManagement釋出管理節點:
例如:
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://你的maven位址/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://你的maven位址/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
注意一下
<groupId>net.funfunle</groupId>
<artifactId>baselib</artifactId>
<!--<version>1.0-SNAPSHOT</version>-->
<version>1.0.1-RELEASE</version>
groupid這些,
<groupId>net.funfunle</groupId>
<artifactId>baselib</artifactId>
<!--<version>1.0-SNAPSHOT</version>-->
<version>1.0.1-RELEASE</version>
決定釋出的是正式版本release還是快照snapshot的是
<!--<version>1.0-SNAPSHOT</version>-->
<version>1.0.1-RELEASE</version>
版本号及釋出類型,有一點也需要注意,snapshot快照允許重複釋出更新同一個版本,而release是不允許的,release每次釋出版本号都要加的。
釋出方式:
在mavenproject點選釋出deploy。
新項目中引用釋出的類庫
maven2擷取最新版本方式。
這裡寫連結内容
maven pom檔案詳解
maven3擷取最新版本方式
這裡寫連結内容
Now I know this topic is old, but reading the question and the OP supplied answer it seems the Maven Versions Plugin might have actually been a better answer to his question:
In particular the following goals could be of use:
versions:use-latest-versions searches the pom for all versions which have been a newer version and replaces them with the latest version.
versions:use-latest-releases searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the latest release version.
versions:update-properties updates properties defined in a project so that they correspond to the latest available version of specific dependencies. This can be useful if a suite of dependencies must all be locked to one version.
The following other goals are also provided:
versions:display-dependency-updates scans a project's dependencies and produces a report of those dependencies which have newer versions available.
versions:display-plugin-updates scans a project's plugins and produces a report of those plugins which have newer versions available.
versions:update-parent updates the parent section of a project so that it references the newest available version. For example, if you use a corporate root POM, this goal can be helpful if you need to ensure you are using the latest version of the corporate root POM.
versions:update-child-modules updates the parent section of the child modules of a project so the version matches the version of the current project. For example, if you have an aggregator pom that is also the parent for the projects that it aggregates and the children and parent versions get out of sync, this mojo can help fix the versions of the child modules. (Note you may need to invoke Maven with the -N option in order to run this goal if your project is broken so badly that it cannot build because of the version mis-match).
versions:lock-snapshots searches the pom for all -SNAPSHOT versions and replaces them with the current timestamp version of that -SNAPSHOT, e.g. --
versions:unlock-snapshots searches the pom for all timestamp locked snapshot versions and replaces them with -SNAPSHOT.
versions:resolve-ranges finds dependencies using version ranges and resolves the range to the specific version being used.
versions:use-releases searches the pom for all -SNAPSHOT versions which have been released and replaces them with the corresponding release version.
versions:use-next-releases searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the next release version.
versions:use-next-versions searches the pom for all versions which have been a newer version and replaces them with the next version.
versions:commit removes the pom.xml.versionsBackup files. Forms one half of the built-in "Poor Man's SCM".
versions:revert restores the pom.xml files from the pom.xml.versionsBackup files. Forms one half of the built-in "Poor Man's SCM".
Just thought I'd include it for any future reference.
譬如: