Saturday, September 28, 2013

maven repository management

  • Nexus

Sonatype Nexus sets the standard for repository management providing development teams with the ability to proxy remote repositories and share software artifacts.
Download Nexus and gain control over open source consumption and internal collaboration.
http://www.sonatype.org/nexus/


  • Artifactory

Artifactory offers powerful enterprise features and fine-grained permission control behind a sleek and easy-to-use UI.
Proxy
Artifactory acts as a proxy between your build tool (Maven, Ant, Ivy, Gradle etc.) and the outside world.
Local Cache
It caches remote artifacts so that you don’t have to download them over and over again
Control
It blocks unwanted (and sometimes security-sensitive) external requests for internal artifacts and controls how and where artifacts are deployed, and by whom.
http://www.jfrog.com/home/v_artifactory_opensource_overview


  • Empower Hudson with Artifactory - Track and Replay Your Build Artifacts

Using one of the different flavors of version control applications, you can easily reproduce the state of any point in the past using the different methods of SCM tagging.

what happens when you want to reproduce binary products from a certain phase?
Are dependencies considered?
Does anyone really remember what version of dependency X was used in version 1.0 or in version 3.1 of your application?
What if you used version ranges or dynamic properties?
Was the application compiled using JDK 5 or 6?
All this information can be recorded during the publication of your binaries, which is usually done by a CI server of your choice.

Your CI server has all the knowledge required in order to reproduce a build:
    Information on the builds themselves
    The published items
    Version information
    Dependencies
    Build environment details

Using Hudson (and others to be supported soon) and Artifactory we've:

    Supplied Hudson with all the needed dependencies from Artifactory—helping us keep the exact dependencies that were used in each build
    Deployed all produced binaries to Artifactory—helping us keep and promote all the products of the build
    Published build information to Artifactory—helping us manage and keep track of every build, environment, product, and dependency


With the assistance of these tools and methods, you will be able to reproduce and execute a build from any point of recorded time or compare information between different builds.


http://java.dzone.com/articles/empower-hudson-artifactory
  • Archiva

Apache Archiva™ is an extensible repository management software that helps taking care of your own personal or enterprise-wide build artifact repository. It is the perfect companion for build tools such as Maven, Continuum, and ANT.
http://archiva.apache.org/

  • In a continuous integration environment, where builds are often triggered by checking in artifacts, there is the potential for a large number of builds to be executed. Each of these builds, at least the successful ones, results in some artifacts being published into the repository. These can start consuming a lot of space, and it is important to manage them.

Archiva provides two different options for automatically cleaning up old snapshots on a per-repository basis:

    Repository Purge by Number of Days Older

    Repository Purge by Retention Count

Both of these options can be viewed and changed by clicking Repositories under the Administration menu and then clicking Edit for the repository you are interested in.

Repository Purge by Number of Days Older

Archiva automatically deletes snapshots older than the specified number of days. Archiva always retains the most recent snapshot, no matter how old it is.

Repository Purge By Retention Count

To use this method, you must set the purge-by-days-older value to 0. Archiva retains only the most recent snapshot instances up to this value. Older instances that exceed this count are deleted.
http://docs.oracle.com/middleware/1212/core/MAVEN/populating_archiva.htm

  • Maven Repository Manager, Archiva in this case, includes the following:

Internal: This repository is used to store finished artifacts that you have built in your development environment.

Snapshot: This repository is used to store work in progress artifacts that you have built in your development environment.

Mirror: This repository is used to store dependencies that have been downloaded from an external repository.

Dev, test, qa, prod: You have one repository for storing the dependencies needed for each target environment. You do this because it is possible that two environments might have the same version of an artifact (for example, 12.1.2-0-0) even though the artifact has been patched in one environment, and is therefore different.
http://docs.oracle.com/middleware/1212/core/MAVEN/intro_ref_ede.htm

  • We use Maven 2 to resolve dependencies and build the source code into packages. 

With the Archiva repository manager we are able to store the needed libraries and to keep track of the daily builds or releases.
Hudson will be the tool to start up the build process every day and notify the developers when the build fails.
By default you'll have 2 Managed repositories. An internal one you can use as a proxy
for the company, and a snapshots repository to put your snapshot builds
Besides those there are
also remote repositories. These are other Maven repositories where Archiva will look for
dependencies when they aren't in your own repositories.
You can also add remote repositories. This is useful if you want to set up a proxy repository for
your company. This way your company users only have to access the internal repository and
don't need to go to the internet.
You can let Hudson poll the SCM and rebuild after every commit. You can also let it build periodical by specifying a cron job



archiva starts up with two hosted repositories configured:

    Internal

    The internal repository is for maintaining fixed-version released artifacts deployed by your organization, which includes finished versions of artifacts, versions that are no longer in development, and released versions. Note that in-development versions of the same artifacts may exist in the snapshot repository in the future.

    Snapshot

    The snapshot repository holds the work-in-progress artifacts, which are denoted with a version with the suffix SNAPSHOT, and artifacts that have not yet been released.
http://docs.oracle.com/middleware/1212/core/MAVEN/populating_archiva.htm


  •  Efficiency. Repository acts as a cache for Maven Central artifacts

    Resilience. Repository protects against remote repository failures or lack of internet connection
    Repeatability. Storing common artifacts centrally, avoids shared build failures caused by developers maintaining their own local repositories.
    Audit. If all 3rd party libraries used by development come from a single entry point in the build process one can assess how often they're used (based on download log files) and what kinds of licensing conditions apply.


http://stackoverflow.com/questions/8259118/good-configuration-for-archiva


  • By default, Archiva comes with a proxy to the mavenSW central repository. Therefore, it's basically all set up to be used as a mirror of the maven central repository. If we make a request of Archiva for an artifact for a central repository artifact, it will download that artifact and return that artifact to us. If we make future requests for that artifact, Archiva will return to us the copy of the artifact that it had already downloaded from the central repository.



http://www.avajava.com/tutorials/lessons/how-do-i-use-archiva-as-a-mirror-of-the-maven-central-repository.html

No comments:

Post a Comment