For versions I think it is a bit more complicated as Maven differentiates snapshot and release artifacts.

For snapshot artifacts, I would use x.y.z-SNAPSHOT in Maven and x.y.z.qualifier in OSGi. This results in discrepancy between expanded -SNAPSHOT and .qualifier for deployed artifacts but I do not think there is a way around it.

For release artifacts, I think Maven and OSGi versions should be the same and the best I can suggest is to use x.y.z.<EXAPNDED-QUALIFIER>. This breaks normal Maven version progression (i.e. x-SNAPSHOT => x), however.

--
Regards,
Igor

Luke Patterson wrote:
On Wed, Mar 4, 2009 at 11:15 PM, Igor Fedorenko <i...@ifedorenko.com> wrote:
I originally hoped that some clever naming scheme would allow resolution of
Eclipse/OSGi dependencies from Maven repositories. Unfortunately, I could
not come up with such a scheme and eventually convinced myself it was not
possible (but I'd be happy to be proved wrong here).

I still believe artifactId == bundleId convention makes sense, but it is not
enforced in Tycho.

I would also use OSGi versions (i.e., major.minor.micro) and use -SNAPSHOT
in manen and .qualifier in OSGi. Again, this is not enforced in Tycho.

Apart from than, I would just follow Maven best practices.

Please let me know if my understanding is correct.  All else being
equal, it seems like new Maven bundle projects would use the following
patterns:

Names:
${project.artifactId} = Bundle-SymbolicName = root package. No dashes
used, only dots.

e.g.
<groupId>org.group</groupId>
<artifactId>${project.groupId}.some.artifact</artifactId>
with the Bundle-SymbolicName: org.group.some.artifact
and the project root package: org.group.some.artifact


Versions:
Maven version = Bundle-Version except for '-' vs '.' before qualifier.
 majorVersion, minorVersion, and incrementalVersion are numeric and
required.  incrementalVersion is alphanumeric and optional.

i.e.
majorVersion.minorVersion.incrementalVersion(-qualifier)? in Maven and
majorVersion.minorVersion.incrementalVersion(.qualifier)? in OSGi's
Bundle-Version


Thoughts?

Luke


Related Info:

----------------------------------------------------------------------------------------------
OSGi Bundle Bundle-SymbolicName
----------------------------------------------------------------------------------------------
OSGi Service Platform Core Specification, Release 4, Version 4.1
http://www.osgi.org/download/r4v41/r4.core.pdf
Section 1.3.2, General Syntax Definitions
symbolic-name :: = token('.'token)*
token ::= ( alphanum | ’_’ | ’-’ )+
alphanum ::= alpha | digit
alpha ::= [a..zA..Z]
digit ::= [0..9]


----------------------------------------------------------------------------------------------
Java Package Name
----------------------------------------------------------------------------------------------
The Java Language Specification, Third Edition
Section 6.8.1, Package Names
http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.8.1
Section 3.8, Identifiers
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.8
QualifiedIdentifier:
  Identifier { . Identifier }
Identifier:
  IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral
IdentifierChars:
  JavaLetter
  IdentifierChars JavaLetterOrDigit
JavaLetter:
  any Unicode character that is a Java letter
  
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#isJavaIdentifierStart(int)
JavaLetterOrDigit:
  any Unicode character that is a Java letter-or-digit
  
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#isJavaIdentifierPart(int)


----------------------------------------------------------------------------------------------
Maven Project Version
----------------------------------------------------------------------------------------------
Maven: The Definitive Guide
9.3.1. Project Versions
http://www.sonatype.com/books/maven-book/reference/pom-relationships-sect-pom-syntax.html#pom-reationships-sect-versions
<major version>.<minor version>.<incremental version>-<qualifier>


----------------------------------------------------------------------------------------------
OSGi Bundle Version
----------------------------------------------------------------------------------------------
OSGi Service Platform Core Specification, Release 4, Version 4.1
http://www.osgi.org/download/r4v41/r4.core.pdf
Section 3.2.4, Version
version ::=
major( '.' minor ( '.' micro ( '.' qualifier )? )? )?
major ::= number
minor ::= number
micro ::= number
qualifier ::= ( alphanum | ’_’ | '-' )+

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to