• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

artipie/maven-adapter: Maven (remote) repository adapter

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

artipie/maven-adapter

开源软件地址(OpenSource Url):

https://github.com/artipie/maven-adapter

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

Join our Telegram group

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

Javadoc License codecov Hits-of-Code Maven Central PDD status

This Java library is turns binary storage (files, S3 objects, anything) into Maven repository. It implements and can work with Maven repository structure and provides fully-functionable mvn support in Artipie binary repository manager service.

If you have any question or suggestions, do not hesitate to create an issue or contact us in Telegram.
Artipie roadmap.

Maven repository concepts

Files

A dependency is identified by its coordinates - groupId, artifactId and version. JAR files may contain a classifier suffix - sources or javadoc. By coordinates you can determine the artifact path in local or remote repository and vice versa.

Repositories must handle following types of files:

  • A primary artifact - a main JAR file.
  • Secondary artifacts - a POM file, files with a classifier.
  • Attribute files - checksums, signatures, lastUpdate files for primary and secondary artifacts.
  • Metadata files - maven-metadata.xml, containing information about artifact versions including snapshot versions.

File naming convention is: artifactId-version[-classifier]-extension

Layout

(Default) naming convention is - in groupId replace all dots with directory separator ('/') then put artifactId, version and then go files.

Example layout (not fully exhaustive):

$ROOT
|-- org/
    `-- example/
        `-- artifact/
            `-- maven-metadata.xml
            `-- maven-metadata.xml.sha1
            `-- 1.0/
                |-- artifact-1.0.jar
                |-- artifact-1.0.jar.sha1
                |-- artifact-1.0.pom
                |-- artifact-1.0.pom.sha1
                |-- artifact-1.0-sources.jar
                |-- artifact-1.0-sources.jar.sha1
            `-- 2.0-SNAPSHOT/
                |-- artifact-2.0-20210409.123503.jar
                |-- artifact-2.0-20210409.123503.jar.sha1
                |-- artifact-2.0-20210409.123503.pom
                |-- artifact-2.0-20210409.123503.pom.sha1
                |-- artifact-2.0-20210412.163503.jar
                |-- artifact-2.0-20210412.163503.jar.sha1
                |-- artifact-2.0-20210412.163503.pom
                |-- artifact-2.0-20210412.163503.pom.sha1
                |-- maven-metadata.xml
                |-- maven-metadata.xml.sha1

For example, for an artifact org.example:artifact:1.0 (Gradle-style notation is used for clarity) the path would be org/example/artifact/1.0/artifact-1.0.jar (and other files).

Snapshot support

Maven supports the use of snapshot repositories. These repositories are used only when resolving SNAPSHOT dependencies. SNAPSHOT dependencies are just like regular dependencies, with -SNAPSHOT appended to it:

<dependency>
    <groupId>com.artipie</groupId>
    <artifactId>maven-adapter</artifactId>
    <version>2.0-SNAPSHOT</version>
</dependency>

This feature allows anyone which depends on the SNAPSHOT version get the latest changes on every build.

In the repository layout snapshots subdirectories usually contain several versions of the package, files creation timestamps are appended to the filenames. Also, snapshots have their own maven metadata.

Upload process

On deploy maven client sends to the server package artifacts with the help of the PUT HTTP requests, at the end of the deploy process maven client sends package metadata. Here an example of maven request set:

PUT /com/artipie/helloworld/1.0/helloworld-1.0.jar
PUT /com/artipie/helloworld/1.0/helloworld-1.0.jar.sha1
PUT /com/artipie/helloworld/1.0/helloworld-1.0.pom
PUT /com/artipie/helloworld/1.0/helloworld-1.0.pom.sha1
GET /com/artipie/helloworld/maven-metadata.xml
PUT /com/artipie/helloworld/maven-metadata.xml
PUT /com/artipie/helloworld/maven-metadata.xml.sha1

Uploaded data are saved to the temporary upload location with the following layout:

|-- .upload
  `-- com
     `--example
        `-- logger
          `-- 0.1-SNAPSHOT
              |-- logger-0.1.jar
              |-- logger-0.1.jar.sha1
              |-- logger-0.1.jar.md5
              |-- logger-0.1.pom
              |-- logger-0.1.pom.sha1
              |-- logger-0.1.pom.md5
              |-- maven-metadata.xml             # snapshot metadata
              |-- maven-metadata.xml.sha1
              |-- maven-metadata.xml.md5
                `-- meta
                    |-- maven-metadata.xml       # package metadata
                    |-- maven-metadata.xml.sha1
                    |-- maven-metadata.xml.md5

Repository update is started when an artifact (any, nondeterministic) and package maven-metadata.xml have the same set of checksums. On the repository update checksums are verified, package metadata are processed and all the received artifacts are saved to the repository.

How to contribute

Fork repository, make changes, send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full Maven build:

$ mvn clean install -Pqulice

To avoid build errors use Maven 3.2+ and please read contributing rules.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap