Probably off topic as the issue is solved,
but wanted to share my experience with you, as I found myself in the same
need stated on the title of this thread.

__Problem:

- Due to an issue with the specific product I'm working on (Alfresco) for
which its Alfresco Module Packages (no more than a type of Zip for which I
defined a custom packaging type AMP) do not allow 'characters in the
versions',
- due to the fact I defined archetypes for AMP [3] packaging and want to use
the filtering and SNAPSHOT capabilities of maven (read: filter
${project.version} into the technology specific module.properties file)

I was unable to use SNAPSHOT versions in my AMP projects as they were
breaking the runtime configuration (as in issue [4]).

__Solution:
An aggregated use of the:
-  maven-buildnumber-plugin (which pushes the ${buildNumber} variable in the
POM
- my homebrew 5 liner mojo (maven-nosnapshot-plugin in our repo here [2], as
trivial as non documented)  which just strips out the '-SNAPSHOT ' part of
the version in case it exists and pushes it in the pom as
${noSnapshotVersion}

This way I could filter my module properties with something like:

module.version=${noSnapshotVersion}.$[buildNumber}

avoiding the Alfresco specific problem while still keeping incremental
versions (mimicking the SNAPSHOT behavior)  of the modules during
development.


My 0.02€ (even if I admit that's a workaround ;)

Ciao!
Gab




[1] http://www.alfresco.com
[2]
http://repository.sourcesense.com/maven2/com/sourcesense/maven/maven-nosnapshot-plugin/0.0.3-SNAPSHOT/
[3]
http://repository.sourcesense.com/maven2-sites/maven-alfresco-amp-archetype/
[4] http://code.google.com/p/maven-alfresco-archetypes/issues/detail?id=15

2009/1/26 Thiago Moreira (timba) <tmoreira2...@gmail.com>

>  Ok, I found the solution!
>
>  To add the Eclipse plugins to the Maven repository you should use the
> maven-eclipse-plugin for it. The goal is
> eclipse:make-artifacts<
> http://maven.apache.org/plugins/maven-eclipse-plugin/make-artifacts-mojo.html
> >
>
>  Cheers
>
> On Sun, Jan 25, 2009 at 1:05 PM, Thiago Moreira (timba) <
> tmoreira2...@gmail.com> wrote:
>
> >
> >   Okay, I found the problem!
> >
> >   Eclipse don't accept "-" on the name of the artifacs... so I changed
> the
> > name to 1.2.3.SNAPSHOT and now I'm good to go.
> >
> >   Another question, how can I reference a Eclipse dependency in the pom
> > file?? Like org.eclipse.core.resources??
> >
> >   Cheers
> >
> >
> > On Sun, Jan 25, 2009 at 8:44 AM, Rusty Wright <rusty.wri...@gmail.com
> >wrote:
> >
> >> If I understand that OSGi version grammar, doesn't that mean that
> >> 1.2.3-SNAPSHOT is an invalid OSGi version number?  I.e., only periods
> are
> >> allowed between the version parts, no dash, and there should be three
> >> periods, not two.  E.g., 1.2.3.SNAPSHOT.
> >>
> >> Does the maven OSGi plugin transform the maven style version number to
> the
> >> OSGi style when creating the bundle/jar?
> >>
> >> I was reading about OSGi over the winter break and it looks like the
> >> answer for various problems.
> >>
> >>
> >>
> >> Baptiste MATHUS wrote:
> >>
> >>> I don't think it is. But I'm not sure I understand what you want to do.
> >>> If
> >>> you're trying to build an eclipse plugin jar from some project, you
> >>> shouldn't do it yourself. There's tools out there that will do it just
> >>> fine:
> >>> have a look at tycho, maven-bundle-plugin, or maven-pde-plugin (this
> last
> >>> one is quite outdated, from what I remember).
> >>>
> >>> These tools will deal just fine with your version number.
> >>>
> >>> Fwiw, here's the OSGi versioning grammar:
> >>> version::=major('.'minor('.'micro('.'qualifier)?)?)?
> >>> major::=digit+
> >>> minor::=digit+
> >>> micro::=digit+
> >>> qualifier::=(alpha|digit|'_'|'-')+
> >>> digit::=[0..9]
> >>> alpha::=[a..zA..Z]
> >>> There must be no whitespace in version.
> >>>
> >>> Cheers
> >>>
> >>> 2009/1/25 Thiago Moreira (timba) <tmoreira2...@gmail.com>
> >>>
> >>>   Hi there,
> >>>>
> >>>>  Is there a way to get only the numbers of the ${pom.version}
> property??
> >>>> Something like this: 1.2.3-SNAPSHOT, I want just the 1.2.3 part.I will
> >>>> use
> >>>> it to build a Eclipse plugin that don't accept Strings on the version
> >>>> property.
> >>>>
> >>>>  Thanks
> >>>>
> >>>>  Thiago Moreira
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> >> For additional commands, e-mail: users-h...@maven.apache.org
> >>
> >>
> >
>



-- 
Gabriele Columbro
Alfresco ECM Product Strategy Consultant
+31 627 565 103
Sourcesense - Making sense of open Source (http://www.sourcesense.com)

Reply via email to