Package org.apache.maven.shared.osgi
Class DefaultMaven2OsgiConverter
- java.lang.Object
-
- org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter
-
- All Implemented Interfaces:
Maven2OsgiConverter
public class DefaultMaven2OsgiConverter extends Object implements Maven2OsgiConverter
Default implementation ofMaven2OsgiConverter
- Version:
- $Id: DefaultMaven2OsgiConverter.java 573759 2007-09-07 23:45:40Z carlos $
- Author:
- Carlos Sanchez
-
-
Constructor Summary
Constructors Constructor Description DefaultMaven2OsgiConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBundleFileName(org.apache.maven.artifact.Artifact artifact)
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.String
getVersion(String version)
Convert a Maven version into an OSGi compliant versionString
getVersion(org.apache.maven.artifact.Artifact artifact)
Convert a Maven version into an OSGi compliant version
-
-
-
Method Detail
-
getBundleSymbolicName
public 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 interfaceMaven2OsgiConverter
- Returns:
- the Bundle-SymbolicName manifest property
-
getBundleFileName
public String getBundleFileName(org.apache.maven.artifact.Artifact artifact)
- Specified by:
getBundleFileName
in interfaceMaven2OsgiConverter
-
getVersion
public 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 interfaceMaven2OsgiConverter
- Parameters:
artifact
- Maven artifact- Returns:
- the OSGi version
-
getVersion
public String getVersion(String version)
Description copied from interface:Maven2OsgiConverter
Convert a Maven version into an OSGi compliant version- Specified by:
getVersion
in interfaceMaven2OsgiConverter
- Parameters:
version
- Maven version- Returns:
- the OSGi version
-
-