What is Aether

原文:《What is Aether

你是否曾經想過把maven依賴解析機制集成到你的應用程序中,並最終嘗試嵌入Plexus和一整個Maven發行版?你是否曾經想過以多線程的方式使用Maven依賴解析機制,卻被其中有狀態的單例程序弄得很困惑?你是否曾經希望更多地控制Maven計算解析依賴關係圖的方式,比如說使用別的策略來解決衝突或者檢查一些中間階段的依賴圖?

Did you ever want to integrate Maven’s dependency resolution mechanism into your application and ended up trying to embed Plexus and an entire Maven distribution? Did you ever want to use Maven’s dependency resolution mechanism in a multi-threaded fashion and got burned by the stateful singletons in there? Did you ever want to have a little more control over how Maven calculates the resolved dependency graph, say use another strategy for conflict resolution or inspect some intermediate dependency graph?

Aether就是你要找的答案。它是一個與Maven 構建物倉庫協同工作的易於嵌入的Java 類庫,使你能夠把構建物從遠程倉庫拉到本地使用,也能把本地構建物發佈到遠程倉庫,以分享給他人。

Well, Aether is the answer. It’s an easily embeddable Java library to work with artifact repositories, enabling you to fetch artifacts from remote repositories for local consumption and to publish local artifacts to remote repositories for sharing with others.

有多種方式傳輸構建物,描述它們之間的關係和使用它們。Aether的設計對這些方面的定製持開放的態度,允許你添加甚至替換掉已有的東西來適應你的需求。實際上,舉個例子,Aether的內核本身並不知道如何與Maven倉庫打交道。它是工具無關的,只提供了一些通用的構建物解析或部署框架並把細節(例如倉庫格式)留給了擴展。

There are many ways to transfer artifacts, to describe their relationships and to use them. Aether was designed with an open mind towards customization of these aspects, allowing you to augment or even replace stock functionality to fit your needs. In fact, the Aether Core itself doesn’t know how to deal with Maven repositories for instance. It’s tool agnostic and provides some general artifact resolution/deployment framework and leaves details like the repository format to extensions.

在這一點上,來自Apache Maven項目的 maven-aether-provider 可能是最有趣的擴展,因爲它很好地支持了Maven倉庫。所以如果你正在尋找一種從中央倉庫獲取並使用構建物的方式,Aether結合Maven Aether Provider 會是你最好的選擇。以這種方式使用Aether不但能減輕處理構建物的工作量,而且能保證與其他操作Maven倉庫的工具的互操作性。

At this point, the maven-aether-provider from the Apache Maven project is probably the most interesting extension as it brings support for, well Maven repositories. So if you’re looking for a way to consume artifacts from the Central Repository, Aether in combination with the Maven Aether Provider is your best bet. Usage of Aether in this way does not only ease your work when dealing with artifacts but also ensures interoperability with other tools that work with Maven repositories.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章