Skip to content
This repository has been archived by the owner on May 18, 2020. It is now read-only.

MavenizerPlugin

Michael Barth edited this page Jul 20, 2017 · 2 revisions

Purpose

There are many ways to create a P2 repository. This plugin converts an existing P2 repository into a maven structured repository. It is possible to convert many repositories with one call.

Declaration

Using this plugin needs the following plugin declarations:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "de.monkeyworks.buildmonkey:gradle.mavenize:0.4.1"
  }
}

apply plugin: "de.monkeyworks.buildmonkey.mavenizer.MavenizerPlugin"

or in the incubating script snippet notation:

plugins {
  id "de.monkeyworks.buildmonkey.mavenizer.MavenizerPlugin" version "0.4.1"
}

Configuration

The plugin allows you converting different P2 repositories into maven repositories with one configuration. Therefore the configuration closure contains one structure per conversion. A configuration can be look like

mavenizeP2Repository {
    mavenizeTask {
        useP2MirrorOutput  = false
        sourceP2Repository = "${buildDir}/p2Repository"
        targetDir          = "${buildDir}/m2Repository"
        groupId            = 'build'
    }

    mavenizeTask {
        useP2MirrorOutput  = true
        sourceP2Repository = "${buildDir}/updatesite"
        targetDir          = "${buildDir}/maven"
        groupId            = 'monkey'
    }
}

The parameters for every mavenizeTask configuration are:

  • useP2MirrorOutput - True, if the output of the mirrorP2Repository task of the P2MirrorPlugin should be used as sourceP2Repository. In this case the next parameter will be overriden.
  • sourceP2Repository - Folder which is a P2 repository and should be converted
  • targetDir - Folder name of the root folder for the maven repository.
  • groupId - Name of the group for all artefacts in the P2 repository.

Gradle tasks

The plugin provides one main tasks (mavenizeP2Repository) which calls the convert tasks and hooks the clean task of gradle removing the targetDirs.

gradle mavenizeRepository