You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Dick <mi...@gmail.com> on 2007/04/11 16:12:35 UTC

Question regarding finalName in maven-assembly-plugin

Hi,

I've noticed that the finalName configuration option for an assembly is
ignored when you install or deploy your project. Is this intended behavior?

I have a project named openjpa-project which contains the a source and
binary assembly which packages various OpenJPA sub-projects. We'd like to
have the resulting zip files named openjpa-${version}-source.zip and
openjpa-${version}-binary.zip, but we're getting openjpa-project-${version}-
source.zip (and the same for -binary) when we deploy or install.

I can provide pom and assembly files if that would help.

Thanks,
-- 
-Michael Dick

Re: Question regarding finalName in maven-assembly-plugin

Posted by John Casey <ca...@gmail.com>.
Traditionally, Maven regards the repository as a database for artifacts.
This means that anything in the repository is meant to be reachable by
Maven. Having said that, most repositories live on some sort of webserver
somewhere, which means the Maven repository is usually just a directory
structure on that webserver...which leads me to my real point:

The intention with all of this was that Maven would index/name artifacts the
way it needed to in order to retrieve them when they're in the repository.
The finalName configurations are preserved in the POM, which is deployed
alongside the artifact. So, anyone who requires an artifact to comply with
its configured finalName should have the appropriate plugins in place during
their build (or whatever) to copy the artifact out of the repository system
into a different directory with the finalName-compliant file name. Now, if
you have no intention of accessing these custom-named files from Maven, why
deploy them to a Maven repository? Why not deploy them *alongside* the Maven
repository on the same webserver? This wouldn't be done using the typical
deployment mechanism, but rather a custom plugin that would just push the
file (I'm assuming you don't need the POM, either) to the appropriate
location, either locally or remotely.

In other words, try not to bend the Maven repository to your external needs.
If you can't work with its format, perhaps you'd be better off constructing
your own directory/file structure alongside the repository?

HTH,

john

On 4/11/07, Michael Dick <mi...@gmail.com> wrote:
>
> I'm not insisting on it either. The artifacts were deployed automatically
> when we deploy the parent project. As far as I know we don't need them in
> the repository though. I'll have to take a closer look.
>
> Thanks for your help.
>
> On 4/11/07, Alan D. Salewski <as...@healthmarketscience.com> wrote:
> >
> > On Wed, Apr 11, 2007 at 09:45:17PM +0200, Heinrich Nirschl spake thus:
> > *snip*
> > > On 4/11/07, Alan D. Salewski <as...@healthmarketscience.com>
> wrote:
> > > >Maybe we need an attribute for 'finalName' that indicates "yes I know
> > > >this name will not be accessible by maven once installed or
> deployed";
> > > >when set maven would deploy the file as named.
> > >
> > > Why insist to put something into a *maven* repository if there is no
> > > intention to access it by maven? Wouldn't it be more useful to be able
> > > to publish to a different place? I don't know, if there already is a
> > > plugin achieving that, but it would not be too hard to build.
> > >
> > > Henry
> >
> > I'm not insisting on it; in fact, I like your idea much better ;-)
> >
> > Our current practice of deploying all of our artifacts to our internal
> > maven repository came about because the infrastructure was already in
> > place and accessible by everyone who needed access to the artifacts.
> >
> > Now that you mention it, though, it would make sense to have an
> > arbitrary deployment plugin. There is precedence for this with other
> > specialized deployment plugins (cargo, tomcat, probably others).
> >
> > -Al
> >
> > --
> > :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
> > ::
> > Alan D. Salewski
> > Software Developer
> > Health Market Science, Inc.
> > :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
> > ::
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> -Michael Dick
>

Re: Question regarding finalName in maven-assembly-plugin

Posted by Michael Dick <mi...@gmail.com>.
I'm not insisting on it either. The artifacts were deployed automatically
when we deploy the parent project. As far as I know we don't need them in
the repository though. I'll have to take a closer look.

Thanks for your help.

On 4/11/07, Alan D. Salewski <as...@healthmarketscience.com> wrote:
>
> On Wed, Apr 11, 2007 at 09:45:17PM +0200, Heinrich Nirschl spake thus:
> *snip*
> > On 4/11/07, Alan D. Salewski <as...@healthmarketscience.com> wrote:
> > >Maybe we need an attribute for 'finalName' that indicates "yes I know
> > >this name will not be accessible by maven once installed or deployed";
> > >when set maven would deploy the file as named.
> >
> > Why insist to put something into a *maven* repository if there is no
> > intention to access it by maven? Wouldn't it be more useful to be able
> > to publish to a different place? I don't know, if there already is a
> > plugin achieving that, but it would not be too hard to build.
> >
> > Henry
>
> I'm not insisting on it; in fact, I like your idea much better ;-)
>
> Our current practice of deploying all of our artifacts to our internal
> maven repository came about because the infrastructure was already in
> place and accessible by everyone who needed access to the artifacts.
>
> Now that you mention it, though, it would make sense to have an
> arbitrary deployment plugin. There is precedence for this with other
> specialized deployment plugins (cargo, tomcat, probably others).
>
> -Al
>
> --
> :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
> ::
> Alan D. Salewski
> Software Developer
> Health Market Science, Inc.
> :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
> ::
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
-Michael Dick

Re: Question regarding finalName in maven-assembly-plugin

Posted by "Alan D. Salewski" <as...@healthmarketscience.com>.
On Wed, Apr 11, 2007 at 09:45:17PM +0200, Heinrich Nirschl spake thus:
*snip*
> On 4/11/07, Alan D. Salewski <as...@healthmarketscience.com> wrote:
> >Maybe we need an attribute for 'finalName' that indicates "yes I know
> >this name will not be accessible by maven once installed or deployed";
> >when set maven would deploy the file as named.
> 
> Why insist to put something into a *maven* repository if there is no
> intention to access it by maven? Wouldn't it be more useful to be able
> to publish to a different place? I don't know, if there already is a
> plugin achieving that, but it would not be too hard to build.
> 
> Henry

I'm not insisting on it; in fact, I like your idea much better ;-)

Our current practice of deploying all of our artifacts to our internal
maven repository came about because the infrastructure was already in
place and accessible by everyone who needed access to the artifacts.

Now that you mention it, though, it would make sense to have an
arbitrary deployment plugin. There is precedence for this with other
specialized deployment plugins (cargo, tomcat, probably others).

-Al

-- 
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Question regarding finalName in maven-assembly-plugin

Posted by Heinrich Nirschl <he...@gmail.com>.
On 4/11/07, Alan D. Salewski <as...@healthmarketscience.com> wrote:
> On Wed, Apr 11, 2007 at 01:27:42PM -0500, Michael Dick spake thus:
> *snip*
> > It seems that the finalName *could* be added in an xml file in the
> > repository. Whether it *should* be added is another issue.

I did not think too much about that, but I guess that something like
this *could* be implemented. There would still be some issues with
snapshot deployments. Also, one has to be careful not to slow down the
standard case by an extra file access.

> I have projects that create artifacts with a 'finalName' set, and these
> artifacts get installed/deployed with the "wrong" file names (that is,
> not what I specified in 'finalName').
>
> In all of my cases, these artifacts do not need to be accessible by
> maven for build purposes, so the fact that the files are installed and
> deployed with names different from what I specified in 'finalName' is
> simply an annoyance (because I then have to rename the files on the
> deployment server "by hand").
>
> Maybe we need an attribute for 'finalName' that indicates "yes I know
> this name will not be accessible by maven once installed or deployed";
> when set maven would deploy the file as named.

Why insist to put something into a *maven* repository if there is no
intention to access it by maven? Wouldn't it be more useful to be able
to publish to a different place? I don't know, if there already is a
plugin achieving that, but it would not be too hard to build.

Henry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Question regarding finalName in maven-assembly-plugin

Posted by "Alan D. Salewski" <as...@healthmarketscience.com>.
On Wed, Apr 11, 2007 at 01:27:42PM -0500, Michael Dick spake thus:
*snip*
> It seems that the finalName *could* be added in an xml file in the
> repository. Whether it *should* be added is another issue.
> 
> FTR I'm just curious whether this is a possibility, or if anyone else thinks
> it would be a good idea. I did look through the mailing list archives
> unfortunately after I posted the question) and I know this issue has come up
> before.
> 
> Thanks again,
> Michael Dick
> 
> On 4/11/07, Heinrich Nirschl <he...@gmail.com> wrote:
> >
> >On 4/11/07, Michael Dick <mi...@gmail.com> wrote:
> >> Hi,
> >>
> >> I've noticed that the finalName configuration option for an assembly is
> >> ignored when you install or deploy your project. Is this intended
> >behavior?
*snip*
> >> --
> >> -Michael Dick
> >>
> >
> >There is no way for maven to access an artifact in the repository if
> >it does not follow the standard naming conventions.
> >
> >Henry

I have projects that create artifacts with a 'finalName' set, and these
artifacts get installed/deployed with the "wrong" file names (that is,
not what I specified in 'finalName').

In all of my cases, these artifacts do not need to be accessible by
maven for build purposes, so the fact that the files are installed and
deployed with names different from what I specified in 'finalName' is
simply an annoyance (because I then have to rename the files on the
deployment server "by hand").

Maybe we need an attribute for 'finalName' that indicates "yes I know
this name will not be accessible by maven once installed or deployed";
when set maven would deploy the file as named.

-Al

-- 
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Question regarding finalName in maven-assembly-plugin

Posted by Michael Dick <mi...@gmail.com>.
Thank you for the explanation,

Wouldn't it be possible to store the finalName in the
maven-metadata.xmlfile or another xml file in the repository? We
already have a unique path in
the repository ${groupId}/${artifactId}/${version}. I'm not interested in
changing the path, just the name of the final jar / zip / whatever.

It seems that the finalName *could* be added in an xml file in the
repository. Whether it *should* be added is another issue.

FTR I'm just curious whether this is a possibility, or if anyone else thinks
it would be a good idea. I did look through the mailing list archives
unfortunately after I posted the question) and I know this issue has come up
before.

Thanks again,
Michael Dick

On 4/11/07, Heinrich Nirschl <he...@gmail.com> wrote:
>
> On 4/11/07, Michael Dick <mi...@gmail.com> wrote:
> > Hi,
> >
> > I've noticed that the finalName configuration option for an assembly is
> > ignored when you install or deploy your project. Is this intended
> behavior?
> >
> > I have a project named openjpa-project which contains the a source and
> > binary assembly which packages various OpenJPA sub-projects. We'd like
> to
> > have the resulting zip files named openjpa-${version}-source.zip and
> > openjpa-${version}-binary.zip, but we're getting
> openjpa-project-${version}-
> > source.zip (and the same for -binary) when we deploy or install.
> >
> > I can provide pom and assembly files if that would help.
> >
> > Thanks,
> > --
> > -Michael Dick
> >
>
> There is no way for maven to access an artifact in the repository if
> it does not follow the standard naming conventions.
>
> Henry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Question regarding finalName in maven-assembly-plugin

Posted by Heinrich Nirschl <he...@gmail.com>.
On 4/11/07, Michael Dick <mi...@gmail.com> wrote:
> Hi,
>
> I've noticed that the finalName configuration option for an assembly is
> ignored when you install or deploy your project. Is this intended behavior?
>
> I have a project named openjpa-project which contains the a source and
> binary assembly which packages various OpenJPA sub-projects. We'd like to
> have the resulting zip files named openjpa-${version}-source.zip and
> openjpa-${version}-binary.zip, but we're getting openjpa-project-${version}-
> source.zip (and the same for -binary) when we deploy or install.
>
> I can provide pom and assembly files if that would help.
>
> Thanks,
> --
> -Michael Dick
>

There is no way for maven to access an artifact in the repository if
it does not follow the standard naming conventions.

Henry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org