You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Pant, Dheeraj" <Dh...@adp.com> on 2007/03/27 23:57:18 UTC

HowTo avoid version number in filenames

Hi,

            Using Maven generates all the artifacts (jars/wars/ears)
with a unique filename <artifactid>-<version>.<type>. How do we remove
the version number from the filenames? I need a generic way to do this,
because we have many sub-modules and would like to have a common
solution that can be reused for every module.

 

I tried the following things:

1. For ear, Maven allows to rename the modules.

2. Using an ant task, rename each jar/war/ear after it gets packaged.

 

However, still classpath within the MANIFEST files (generated using
Maven) refers to unique filenames including their version numbers. We
don't want to hardcode our manifest files. I tried specifying project
specific modules as system dependency - did not work.

 

Is there a way out?

 

Thanks,

Dheeraj.

 



-----------------------------------------
This message and any attachments are intended only for the use of
the addressee and may contain information that is privileged and
confidential. If the reader of the message is not the intended
recipient or an authorized representative of the intended
recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this
communication in error, notify the sender immediately by return
email and delete the message and any attachments from your system.

Re: HowTo avoid version number in filenames

Posted by Ralph Goers <Ra...@dslextreme.com>.
Just curious, but I'm interested in why you want to do this.  It drives 
me nuts when I get a product such as Jboss and I can't figure out what 
version it is using just by looking at the file name.  OTOH, I'd be just 
as happy to run a command line program that could accurately tell me the 
version from the info in the jar. I guess I could write one, assuming it 
was including in the manifest.

Ralph

Pant, Dheeraj wrote:
> Hi,
>
>             Using Maven generates all the artifacts (jars/wars/ears)
> with a unique filename <artifactid>-<version>.<type>. How do we remove
> the version number from the filenames? I need a generic way to do this,
> because we have many sub-modules and would like to have a common
> solution that can be reused for every module.
>
>  
>
> I tried the following things:
>
> 1. For ear, Maven allows to rename the modules.
>
> 2. Using an ant task, rename each jar/war/ear after it gets packaged.
>
>  
>
> However, still classpath within the MANIFEST files (generated using
> Maven) refers to unique filenames including their version numbers. We
> don't want to hardcode our manifest files. I tried specifying project
> specific modules as system dependency - did not work.
>
>  
>
> Is there a way out?
>
>  
>
> Thanks,
>
> Dheeraj.
>
>  
>
>
>
> -----------------------------------------
> This message and any attachments are intended only for the use of
> the addressee and may contain information that is privileged and
> confidential. If the reader of the message is not the intended
> recipient or an authorized representative of the intended
> recipient, you are hereby notified that any dissemination of this
> communication is strictly prohibited. If you have received this
> communication in error, notify the sender immediately by return
> email and delete the message and any attachments from your system.
>   

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


Re: HowTo avoid version number in filenames

Posted by Franz Allan Valencia See <fr...@gmail.com>.
Yep, but it's enough if you're deploying to some container and you don't
want the wars your deploying to have version number :)

On 3/28/07, Stephane Nicoll <st...@gmail.com> wrote:
>
> Hi,
>
> On 3/28/07, Franz Allan Valencia See <fr...@gmail.com> wrote:
> > Good day to you, Dheeraj,
> >
> > Try
> >
> > <project>
> >   ...
> >   <build>
> >     <finalName>${artifactId}</finalName>
> >     ...
> >   </build>
> >   ...
> > </project>
> >
> > By default, the value of finalName is "${artifactId}-${version}" (
> without
> > the quotes ) which every pom inherits from the super pom ( see [1] ).
>
> This is not honored by the deploy/install plugins so I am not sure
> it's fixing anything.
>
> >
> > ..btw, you might want to try asking in the maven users list next time to
> get
> > a faster response :)
>
> +1
>
> Stéphane
>
>
> >
> > Cheers,
> > Franz
> >
> > [1]
> http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
> >
> > On 3/27/07, Pant, Dheeraj <Dh...@adp.com> wrote:
> > >
> > > Hi,
> > >
> > >             Using Maven generates all the artifacts (jars/wars/ears)
> > > with a unique filename <artifactid>-<version>.<type>. How do we remove
> > > the version number from the filenames? I need a generic way to do
> this,
> > > because we have many sub-modules and would like to have a common
> > > solution that can be reused for every module.
> > >
> > >
> > >
> > > I tried the following things:
> > >
> > > 1. For ear, Maven allows to rename the modules.
> > >
> > > 2. Using an ant task, rename each jar/war/ear after it gets packaged.
> > >
> > >
> > >
> > > However, still classpath within the MANIFEST files (generated using
> > > Maven) refers to unique filenames including their version numbers. We
> > > don't want to hardcode our manifest files. I tried specifying project
> > > specific modules as system dependency - did not work.
> > >
> > >
> > >
> > > Is there a way out?
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Dheeraj.
> > >
> > >
> > >
> > >
> > >
> > > -----------------------------------------
> > > This message and any attachments are intended only for the use of
> > > the addressee and may contain information that is privileged and
> > > confidential. If the reader of the message is not the intended
> > > recipient or an authorized representative of the intended
> > > recipient, you are hereby notified that any dissemination of this
> > > communication is strictly prohibited. If you have received this
> > > communication in error, notify the sender immediately by return
> > > email and delete the message and any attachments from your system.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: HowTo avoid version number in filenames

Posted by Joakim Erdfelt <jo...@erdfelt.com>.
The fact that install / deploy process maintains the filename with a
version in it is simple.

The repository is to be thought of as a database.
The local repository is to be thought of as a remote repository cache.

The repository database *needs* versioning.

The plugins that bundle the artifacts within other files (such a
assembly, war, ear, etc...) honor the <finalName> setting when working
on the artifacts outside of the Repository database.

- Joakim

Stephane Nicoll wrote:
> Hi,
>
> On 3/28/07, Franz Allan Valencia See <fr...@gmail.com> wrote:
>> Good day to you, Dheeraj,
>>
>> Try
>>
>> <project>
>>   ...
>>   <build>
>>     <finalName>${artifactId}</finalName>
>>     ...
>>   </build>
>>   ...
>> </project>
>>
>> By default, the value of finalName is "${artifactId}-${version}" (
>> without
>> the quotes ) which every pom inherits from the super pom ( see [1] ).
>
> This is not honored by the deploy/install plugins so I am not sure
> it's fixing anything.
>
>>
>> ..btw, you might want to try asking in the maven users list next time
>> to get
>> a faster response :)
>
> +1
>
> Stéphane
>
>
>>
>> Cheers,
>> Franz
>>
>> [1]
>> http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
>>
>> On 3/27/07, Pant, Dheeraj <Dh...@adp.com> wrote:
>> >
>> > Hi,
>> >
>> >             Using Maven generates all the artifacts (jars/wars/ears)
>> > with a unique filename <artifactid>-<version>.<type>. How do we remove
>> > the version number from the filenames? I need a generic way to do
>> this,
>> > because we have many sub-modules and would like to have a common
>> > solution that can be reused for every module.
>> >
>> >
>> >
>> > I tried the following things:
>> >
>> > 1. For ear, Maven allows to rename the modules.
>> >
>> > 2. Using an ant task, rename each jar/war/ear after it gets packaged.
>> >
>> >
>> >
>> > However, still classpath within the MANIFEST files (generated using
>> > Maven) refers to unique filenames including their version numbers. We
>> > don't want to hardcode our manifest files. I tried specifying project
>> > specific modules as system dependency - did not work.
>> >
>> >
>> >
>> > Is there a way out?
>> >
>> >
>> >
>> > Thanks,
>> >
>> > Dheeraj.
>> >
>> >
>> >
>> >
>> >
>> > -----------------------------------------
>> > This message and any attachments are intended only for the use of
>> > the addressee and may contain information that is privileged and
>> > confidential. If the reader of the message is not the intended
>> > recipient or an authorized representative of the intended
>> > recipient, you are hereby notified that any dissemination of this
>> > communication is strictly prohibited. If you have received this
>> > communication in error, notify the sender immediately by return
>> > email and delete the message and any attachments from your system.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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


Re: HowTo avoid version number in filenames

Posted by Stephane Nicoll <st...@gmail.com>.
Hi,

On 3/28/07, Franz Allan Valencia See <fr...@gmail.com> wrote:
> Good day to you, Dheeraj,
>
> Try
>
> <project>
>   ...
>   <build>
>     <finalName>${artifactId}</finalName>
>     ...
>   </build>
>   ...
> </project>
>
> By default, the value of finalName is "${artifactId}-${version}" ( without
> the quotes ) which every pom inherits from the super pom ( see [1] ).

This is not honored by the deploy/install plugins so I am not sure
it's fixing anything.

>
> ..btw, you might want to try asking in the maven users list next time to get
> a faster response :)

+1

Stéphane


>
> Cheers,
> Franz
>
> [1] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
>
> On 3/27/07, Pant, Dheeraj <Dh...@adp.com> wrote:
> >
> > Hi,
> >
> >             Using Maven generates all the artifacts (jars/wars/ears)
> > with a unique filename <artifactid>-<version>.<type>. How do we remove
> > the version number from the filenames? I need a generic way to do this,
> > because we have many sub-modules and would like to have a common
> > solution that can be reused for every module.
> >
> >
> >
> > I tried the following things:
> >
> > 1. For ear, Maven allows to rename the modules.
> >
> > 2. Using an ant task, rename each jar/war/ear after it gets packaged.
> >
> >
> >
> > However, still classpath within the MANIFEST files (generated using
> > Maven) refers to unique filenames including their version numbers. We
> > don't want to hardcode our manifest files. I tried specifying project
> > specific modules as system dependency - did not work.
> >
> >
> >
> > Is there a way out?
> >
> >
> >
> > Thanks,
> >
> > Dheeraj.
> >
> >
> >
> >
> >
> > -----------------------------------------
> > This message and any attachments are intended only for the use of
> > the addressee and may contain information that is privileged and
> > confidential. If the reader of the message is not the intended
> > recipient or an authorized representative of the intended
> > recipient, you are hereby notified that any dissemination of this
> > communication is strictly prohibited. If you have received this
> > communication in error, notify the sender immediately by return
> > email and delete the message and any attachments from your system.
>

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


Re: HowTo avoid version number in filenames

Posted by Franz Allan Valencia See <fr...@gmail.com>.
Good day to you, Dheeraj,

Try

<project>
  ...
  <build>
    <finalName>${artifactId}</finalName>
    ...
  </build>
  ...
</project>

By default, the value of finalName is "${artifactId}-${version}" ( without
the quotes ) which every pom inherits from the super pom ( see [1] ).

..btw, you might want to try asking in the maven users list next time to get
a faster response :)

Cheers,
Franz

[1] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

On 3/27/07, Pant, Dheeraj <Dh...@adp.com> wrote:
>
> Hi,
>
>             Using Maven generates all the artifacts (jars/wars/ears)
> with a unique filename <artifactid>-<version>.<type>. How do we remove
> the version number from the filenames? I need a generic way to do this,
> because we have many sub-modules and would like to have a common
> solution that can be reused for every module.
>
>
>
> I tried the following things:
>
> 1. For ear, Maven allows to rename the modules.
>
> 2. Using an ant task, rename each jar/war/ear after it gets packaged.
>
>
>
> However, still classpath within the MANIFEST files (generated using
> Maven) refers to unique filenames including their version numbers. We
> don't want to hardcode our manifest files. I tried specifying project
> specific modules as system dependency - did not work.
>
>
>
> Is there a way out?
>
>
>
> Thanks,
>
> Dheeraj.
>
>
>
>
>
> -----------------------------------------
> This message and any attachments are intended only for the use of
> the addressee and may contain information that is privileged and
> confidential. If the reader of the message is not the intended
> recipient or an authorized representative of the intended
> recipient, you are hereby notified that any dissemination of this
> communication is strictly prohibited. If you have received this
> communication in error, notify the sender immediately by return
> email and delete the message and any attachments from your system.