## org.apache.maven.shared.osgi
Class DefaultMaven2OsgiConverter

    java.lang.Object
      org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter

All Implemented Interfaces:
  Maven2OsgiConverter

    public class DefaultMaven2OsgiConverter

extends java.lang.Object
implements Maven2OsgiConverter

Default implementation of `Maven2OsgiConverter`

Version:
  $Id: DefaultMaven2OsgiConverter.java 661727 2008-05-30 14:21:49Z bentmann $
Author:
  Carlos Sanchez

Constructor Summary
`DefaultMaven2OsgiConverter()`

Method Summary
`static java.lang.String` `cleanupVersion(java.lang.String version)`
`java.lang.String` `getBundleFileName(org.apache.maven.artifact.Artifact artifact)`

`java.lang.String`

`getBundleSymbolicName(org.apache.maven.artifact.Artifact artifact)`
Get the symbolic name as groupId + "." + artifactId, with the following exceptions if artifact.getFile is not null and the jar contains a OSGi Manifest with Bundle-SymbolicName property then that value is returned if groupId has only one section (no dots) and artifact.getFile is not null then the first package name with classes is returned.

`java.lang.String` `getVersion(org.apache.maven.artifact.Artifact artifact)` Convert a Maven version into an OSGi compliant version
`java.lang.String` `getVersion(java.lang.String version)` Convert a Maven version into an OSGi compliant version

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultMaven2OsgiConverter

    public DefaultMaven2OsgiConverter()

Method Detail

### getBundleSymbolicName

    public java.lang.String getBundleSymbolicName(org.apache.maven.artifact.Artifact artifact)

  Get the symbolic name as groupId + "." + artifactId, with the following exceptions
  - if artifact.getFile is not null and the jar contains a OSGi Manifest with Bundle-SymbolicName property then that value is returned
  - if groupId has only one section (no dots) and artifact.getFile is not null then the first package name with classes is returned. eg. commons-logging:commons-logging -> org.apache.commons.logging
  - if artifactId is equal to last section of groupId then groupId is returned. eg. org.apache.maven:maven -> org.apache.maven
  - if artifactId starts with last section of groupId that portion is removed. eg. org.apache.maven:maven-core -> org.apache.maven.core

  Specified by:
    `getBundleSymbolicName` in interface `Maven2OsgiConverter`
  Returns:
    the Bundle-SymbolicName manifest property

### getBundleFileName

    public java.lang.String getBundleFileName(org.apache.maven.artifact.Artifact artifact)

  Specified by:
    `getBundleFileName` in interface `Maven2OsgiConverter`

### getVersion

    public java.lang.String getVersion(org.apache.maven.artifact.Artifact artifact)

  Description copied from interface: `Maven2OsgiConverter`
  Convert a Maven version into an OSGi compliant version

  Specified by:
    `getVersion` in interface `Maven2OsgiConverter`
  Parameters:
    `artifact` - Maven artifact
  Returns:
    the OSGi version

### getVersion

    public java.lang.String getVersion(java.lang.String version)

  Description copied from interface: `Maven2OsgiConverter`
  Convert a Maven version into an OSGi compliant version

  Specified by:
    `getVersion` in interface `Maven2OsgiConverter`
  Parameters:
    `version` - Maven version
  Returns:
    the OSGi version

### cleanupVersion

    public static java.lang.String cleanupVersion(java.lang.String version)

Copyright © 2011. All Rights Reserved.