Extension:MavenRepository

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
MavenRepository
Release status: stable
Implementation Parser function
Description Adds parser functions to output several informations from a Maven repository.
Author(s) Stéphane GALLAND (sgalland-arakhnetalk)
Latest version 1.2
License GPL
Download http://www.arakhne.org/mediawiki/MavenRepository/
Translate the MavenRepository extension if it is available at translatewiki.net
Check usage and version matrix.

Description[edit]

MavenRepository is an extension of MediaWiki to retreive files and informations from a Maven repository.

Example: http://www.janus-project.org/index.php/Download

Installation[edit]

  1. Download MavenRepository,
  2. Unpack the archive in your Mediawiki directory
  3. add require_once('extensions/MavenRepository/MavenRepository.php'); in your LocalSettings.php.


Configuration[edit]

MavenRepository extension uses several global variables which may be set in LocalSetting.php:

  • $wgMvnRepoPaths
    Defines the paths to the Maven repositories. It is an associative array of (repository_local_path => repository_url).

Usage[edit]

MavenRepository provides several parser functions, explained below. In all the following explanations MID represents a standard Maven group-artefact pair: a group identifier, a column character, and an artifact identifier.

{{#mvngroupid}}[edit]

Reports group identifier from the given module identifier. For example:

{{#mvngroupid: org.arakhne.afc:arakhneVmutils}}

Gives: org.arakhne.afc

{{#mvnartifactid}}[edit]

Reports artifact identifier from the given module identifier. For example:

{{#mvnartifactid: org.arakhne.afc:arakhneVmutils}}

Gives: arakhneVmutils

{{#mvnversion}}[edit]

Reports the version of the maven module. For example:

{{#mvnversion: org.arakhne.afc:arakhneVmutils | *}}

Gives: 1.0-SNAPSHOT

{{#mvndate}}[edit]

Reports the distribution date of the maven module. For example:

{{#mvndate: org.arakhne.afc:arakhneVmutils | *}}

Gives: 03 Aug 2010 07:04:39

{{#mvnrepository}}[edit]

Reports the URL of the last release of the maven module. For example:

{{#mvnrepository: org.arakhne.afc:arakhneVmutils | *}}

Gives: http://download.tuxfamily.org/arakhne/maven/org/arakgne/afc/arakhneVmutils/1.0-SNAPSHOT/

{{#mvnrepositorylink}}[edit]

Reports the URL of the last release of the maven module. For example:

{{#mvnrepositorylink: org.arakhne.afc:arakhneVmutils | * | Label}}

Gives: Label

{{#mvnjar}}[edit]

Reports the path to the Jar of the last release of the maven module. For example:

{{#mvnjar: org.arakhne.afc:arakhneVmutils | * | sources}}

Gives: org/arakgne/afc/arakhneVmutils/1.0-SNAPSHOT/arakhneVmutils-1.0-SNAPSHOT-sources.jar

{{#mvnjarname}}[edit]

Reports the name to the Jar of the last release of the maven module. For example:

{{#mvnjarname: org.arakhne.afc:arakhneVmutils | * | sources}}

Gives: arakhneVmutils-1.0-SNAPSHOT-sources.jar

{{#mvnjarsize}}[edit]

Reports the size to the Jar of the last release of the maven module. For example:

{{#mvnjarsize: org.arakhne.afc:arakhneVmutils | * | sources}}

Gives: 1.7 GB

{{#mvnjarlink}}[edit]

Reports the hyperlink to the Jar of the last release of the maven module. For example:

{{#mvnjarlink: org.arakhne.afc:arakhneVmutils | * | sources}}

Gives: arakhneVmutils-1.0-SNAPSHOT-sources.jar

{{#mvnjarlist}}[edit]

Reports a list of the hyperlinks to the Jar files of the last release of the maven modules inside the given group. For example, because arakhneLogger, arakhneRefs, and arakhneVmutils are artifacts in group org.arakhne.afc:

{{#mvnjarlist: org.arakhne.afc | * | sources}}

Gives:

Changes[edit]

  • 1.2 : {{#mvnjarsize}} is added. It is expanded to the size of the jar file in the Maven repository.
  • 1.1 : {{#mvnjarlist}} is introduced. It permits to output a list of links to jars for all artifacts inside a group..
  • 1.0 : First Public Release on Mediawiki website.