public void execute() throws MojoExecutionException, MojoFailureException { for ( String name : versions.keySet() ) { String version = versions.get( name ); String osgi = maven2OsgiConverter.getVersion( version ); project.getProperties().put( name, osgi ); } } }
String getBundleVersion(Artifact a, boolean pde) { String version = mavenOsgi.getVersion(a); String suffix = ".SNAPSHOT"; if (version.endsWith(suffix)) { version = version.substring(0, version.length() - suffix.length()); if (pde) { version = version + ".qualifier"; } else { version = version + "-" + df.format(new Date()); } } return version; }
/** * Convert a Maven version into an OSGi compliant version * * @param version Maven version * @return the OSGi version */ protected String convertVersionToOsgi( String version ) { return getMaven2OsgiConverter().getVersion( version ); }
/** * <p> * Format the artifact information into an Eclipse-friendly plug-in name. Delegates to maven2OsgiConverter to obtain * bundle symbolic name and version. * </p> */ private String formatEclipsePluginName( Artifact artifact ) { return maven2OsgiConverter.getBundleSymbolicName( artifact ) + "_" + maven2OsgiConverter.getVersion( artifact.getVersion() ); }
public String cleanupVersion(String version) { return super.getMaven2OsgiConverter().getVersion(version); }
public String calculateBundleVersion(Artifact artifact) { return super.getMaven2OsgiConverter().getVersion(aetherToMavenArtifactBasic(artifact)); }
properties.put( Analyzer.BUNDLE_SYMBOLICNAME, bsn ); properties.put( Analyzer.IMPORT_PACKAGE, "*" ); properties.put( Analyzer.BUNDLE_VERSION, getMaven2OsgiConverter().getVersion( currentProject.getVersion() ) );
/** * Merge bundle into a start level using the supplied level if present. * @param mergeStartLevel * @param newBnd */ private void add(StartLevel mergeStartLevel, Bundle newBnd) { Bundle current = get(newBnd, false); if (current != null) { final Maven2OsgiConverter converter = new DefaultMaven2OsgiConverter(); // compare versions, the highest will be used final Version newVersion = new Version(converter.getVersion(newBnd.getVersion())); final Version oldVersion = new Version(converter.getVersion(current.getVersion())); if ( newVersion.compareTo(oldVersion) > 0 ) { current.setVersion(newBnd.getVersion()); } } else { StartLevel startLevel = null; if ( mergeStartLevel == null || newBnd.getStartLevel() != 0) { startLevel = getOrCreateStartLevel(newBnd.getStartLevel()); } else { startLevel = getOrCreateStartLevel(mergeStartLevel.getStartLevel()); } startLevel.getBundles().add(newBnd); } }