2009/11/26 Rex Wang <[email protected]>

> IIRC,if using maven manages the project and build,  there is no way to
> specify the separator between the version and identifier. The format
> <artifactId>-<version>.jar is a maven convention. Eclipse's bundles always
> have a "_" in their names, I think that because they do not adopt maven.
> -Rex
>

FYI the name of the artifact generated inside the output directory (ie.
target) can be
changed by setting a custom <finalName> value in the <build> section of the
pom:

So setting:

  <build>
    <!-- default finalName is ${project.groupId}-${project.artifactId} -->
    <finalName>${project.groupId}_${project.artifactId}</finalName>
    ...
  </build>

would alter the final artifact name in the target directory - *however* it
will not change
the name of the artifact in the Maven repository (local or remote) because
that is set
by the repository layout, otherwise you couldn't map a G:A:V onto a
repository URL

This is often a source of confusion, so people rarely set finalName unless
absolutely
necessary. And as others have pointed out, the name of the jar is not so
important
with OSGi because the important details are captured in the manifest.

Over at Felix we use artifactIds that include 'org.apache.felix' so that the
individual
JAR filename still refers to Felix, even though it causes some level of
duplication.

One last thing... people new to Maven might find these sites useful:

  [1]  http://www.sonatype.com/books/maven-book/reference/public-book.html
  [2]  http://maven.apache.org/pom.html
  [3]
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
  [4]
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

-- 
Cheers, Stuart

2009/11/26 Alasdair Nottingham <[email protected]>
>
> > DOH, I thought I tried that, but it does indeed appear to fix the
> problem.
> >
> > Do you know how to get the separator between the artifact id and the
> > version to be an '_' rather than a '-'? Also I think the separator
> > between the version "1.0.0" and the build identifier should be a '.',
> > is that possible?
> >
> > Thanks
> > Alasdair
> >
> > 2009/11/25 Lin Sun <[email protected]>:
> > > Hi,
> > >
> > > I think this can be changed by modifying the pom file.  for example,
> > > for blueprint-bundle:
> > >
> > > -    <artifactId>aries-blueprint</artifactId>
> > > +    <artifactId>org.apache.aries.blueprint</artifactId>
> > >
> > > I'd be happy to make the change if there is no objection.
> > >
> > > Lin
> > >
> > >
> > > On Wed, Nov 25, 2009 at 1:12 PM, Alasdair Nottingham
> > > <[email protected]> wrote:
> > >> Hi,
> > >>
> > >> The jar files generated by our build do not have the format I usually
> > >> expect for OSGi bundle jar files. I expect to see something of the
> > >> form:
> > >>
> > >> org.apache.aries.blueprint_1.0.0.incubating-SNAPSHOT.jar
> > >>
> > >> but instead we get:
> > >>
> > >> aries-blueprint-1.0.0-incubating-SNAPSHOT.jar
> > >>
> > >> I've had a look at the pom files, but I do not know how the jar file
> > >> name is generated, so I do not know how to change it to follow the
> > >> bundle naming convention.
> > >>
> > >> Does anyone know what needs to be done?
> > >> Thanks
> > >> Alasdair
> > >>
> > >> --
> > >> Alasdair Nottingham
> > >> [email protected]
> > >>
> > >
> >
> >
> >
> > --
> > Alasdair Nottingham
> > [email protected]
> >
>

Reply via email to