Git Product home page Git Product logo

maven-adapter's Introduction

Maven Build License Hits-of-Code PDD status GitHub commit activity Codecov

maven-adapter

Maven repository adapter

com.artipie.maven.Maven is the central entrypoint for all operations. It uses a com.artipie.asto.Storage to store Maven artifacts.

Current implementation is focused on generating metadata for artifacts on repository.

Taking the repository described above in Layout section, for example, let's suppose that a new version, 2.0 was uploaded to the repository. We generate the metadata this way:

    Metadata updated = new Maven(
        storage
    ).update("org.example.artifact");

The metadata.xml file will be generated with the recently added data pertaining to version 2.0.

Maven 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

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 repositories 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.

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+.

maven-adapter's People

Contributors

g4s8 avatar olenagerasimova avatar paulodamaso avatar olegmoz avatar dependabot-preview[bot] avatar yegor256 avatar victornoel avatar dependabot[bot] avatar genryxy avatar carlosmiranda avatar ilyamoskva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.