You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Oleg Taranenko <ta...@googlemail.com> on 2009/02/22 15:25:55 UTC

Rename file in target dir

Hello Maven,

  I have a dumb question working with assembly plugin, sorry. How I
  can rename the artifact jar from format mytool-1.0.1-SNAPSHOT.jar to
  mytool.jar, before packaging it into assembly?

  I'm using now bootstrap batch file a la mvn.bat.

java -classpath %MYTOOL_HOME%\lib\mytool-1.0.1-SNAPSHOT.jar org.tigris.mytool.App

  I'd like to replace it with

java -classpath %MYTOOL_HOME%\lib\mytool.jar org.tigris.mytool.App

and do not changing mytool.bat from version to version.

-- 
Best regards,
 Oleg                          mailto:taranenko.forums@gmail.com


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


Re: Rename file in target dir

Posted by Oleg Taranenko <ta...@googlemail.com>.
Martin,

idea was to avoid changing of the batch along with version changing.
Though the solution is found, see the other answers in thread, I thank
you for your email.

Cheers, Oleg

am Sunday, February 22, 2009 um 5:18 PM schrieben Sie:


> is there a reason why you prefer to change jar name over adding your custom jar to the classpath
> java -classpath
> %MYTOOL_HOME%\lib\mytool-1.0.1-SNAPSHOT.jar;mytool.jar org.tigris.mytool.App
> ?
> Martin 
> ______________________________________________ 
> Disclaimer and confidentiality note 
> Everything in this e-mail and any attachments relates to the
> official business of Sender. This transmission is of a confidential
> nature and Sender does not endorse distribution to any party other
> than intended recipient. Sender does not necessarily endorse content
> contained within this transmission. 




>> Date: Sun, 22 Feb 2009 15:25:55 +0100
>> From: taranenko.forums@googlemail.com
>> To: users@maven.apache.org
>> Subject: Rename file in target dir
>> 
>> Hello Maven,
>> 
>>   I have a dumb question working with assembly plugin, sorry. How I
>>   can rename the artifact jar from format mytool-1.0.1-SNAPSHOT.jar to
>>   mytool.jar, before packaging it into assembly?
>> 
>>   I'm using now bootstrap batch file a la mvn.bat.
>> 
>> java -classpath %MYTOOL_HOME%\lib\mytool-1.0.1-SNAPSHOT.jar org.tigris.mytool.App
>> 
>>   I'd like to replace it with
>> 
>> java -classpath %MYTOOL_HOME%\lib\mytool.jar org.tigris.mytool.App
>> 
>> and do not changing mytool.bat from version to version.
>> 
>> -- 
>> Best regards,
>>  Oleg                          mailto:taranenko.forums@gmail.com
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 

> _________________________________________________________________
> Windows Live™: Discover 10 secrets about the new Windows Live.  
> http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!7540.entry?ocid=TXT_TAGLM_WL_t2_ugc_post_022009


-- 
Mit freundlichen Grüßen
Oleg Taranenko
mailto:olegtaranenko@googlemail.com



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


RE: Rename file in target dir

Posted by Martin Gainty <mg...@hotmail.com>.
is there a reason why you prefer to change jar name over adding your custom jar to the classpath 
java -classpath %MYTOOL_HOME%\lib\mytool-1.0.1-SNAPSHOT.jar;mytool.jar org.tigris.mytool.App
?
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




> Date: Sun, 22 Feb 2009 15:25:55 +0100
> From: taranenko.forums@googlemail.com
> To: users@maven.apache.org
> Subject: Rename file in target dir
> 
> Hello Maven,
> 
>   I have a dumb question working with assembly plugin, sorry. How I
>   can rename the artifact jar from format mytool-1.0.1-SNAPSHOT.jar to
>   mytool.jar, before packaging it into assembly?
> 
>   I'm using now bootstrap batch file a la mvn.bat.
> 
> java -classpath %MYTOOL_HOME%\lib\mytool-1.0.1-SNAPSHOT.jar org.tigris.mytool.App
> 
>   I'd like to replace it with
> 
> java -classpath %MYTOOL_HOME%\lib\mytool.jar org.tigris.mytool.App
> 
> and do not changing mytool.bat from version to version.
> 
> -- 
> Best regards,
>  Oleg                          mailto:taranenko.forums@gmail.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

_________________________________________________________________
Windows Live™: Discover 10 secrets about the new Windows Live.  
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!7540.entry?ocid=TXT_TAGLM_WL_t2_ugc_post_022009

Re: Rename file in target dir

Posted by Oleg Taranenko <ol...@googlemail.com>.
Wendy Smoak,

although I've already solutions (ironically, looking at the mvn.bat)
I'm very appreciate to your pointing. Sure later it will be required.

In this case solution is simple and fit to me.

some lines before call loop:
for %%i in ("%MYTOOL_HOME%\lib\mytool*") do set MYTOOL_JAR="%%i"

then
%MYTOOL_JAVA_EXE% %MYTOOL_OPTS% -classpath %MYTOOL_JAR% "-Dmytool.home=%MYTOOL_HOME%" org.tigris.mytool.App %MYTOOL_CMD_LINE_ARGS%

Cheers, Oleg

am Sunday, February 22, 2009 um 4:13 PM schrieben Sie:

> On Sun, Feb 22, 2009 at 7:25 AM, Oleg Taranenko
> <ta...@googlemail.com> wrote:

>> How I
>>  can rename the artifact jar from format mytool-1.0.1-SNAPSHOT.jar to
>>  mytool.jar, before packaging it into assembly?
>>
>>  I'm using now bootstrap batch file a la mvn.bat.
>> java -classpath %MYTOOL_HOME%\lib\mytool-1.0.1-SNAPSHOT.jar org.tigris.mytool.App
>>  I'd like to replace it with
>> java -classpath %MYTOOL_HOME%\lib\mytool.jar org.tigris.mytool.App
>> and do not changing mytool.bat from version to version.

> How about filtering the version number into mytool.bat automatically,
> so that you don't have to change it?

> If you do decide to change the filename, then the
> 'outputFileNameMapping' element in the assembly descriptor sounds like
> it might do what you want.

> http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet

> outputFileNameMapping    Sets the mapping pattern for all dependencies
> included in this assembly. Default is
> ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}.
> (Since 2.2-beta-2; 2.2-beta-1 uses
> ${artifactId}-${version}${dashClassifier?}.${extension}) The default
> value is
> ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}.




-- 
Mit freundlichen Grüßen
Oleg Taranenko
mailto:olegtaranenko@googlemail.com



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


Re: Rename file in target dir

Posted by Wendy Smoak <ws...@gmail.com>.
On Sun, Feb 22, 2009 at 7:25 AM, Oleg Taranenko
<ta...@googlemail.com> wrote:

> How I
>  can rename the artifact jar from format mytool-1.0.1-SNAPSHOT.jar to
>  mytool.jar, before packaging it into assembly?
>
>  I'm using now bootstrap batch file a la mvn.bat.
> java -classpath %MYTOOL_HOME%\lib\mytool-1.0.1-SNAPSHOT.jar org.tigris.mytool.App
>  I'd like to replace it with
> java -classpath %MYTOOL_HOME%\lib\mytool.jar org.tigris.mytool.App
> and do not changing mytool.bat from version to version.

How about filtering the version number into mytool.bat automatically,
so that you don't have to change it?

If you do decide to change the filename, then the
'outputFileNameMapping' element in the assembly descriptor sounds like
it might do what you want.

http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet

outputFileNameMapping 	 Sets the mapping pattern for all dependencies
included in this assembly. Default is
${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}.
(Since 2.2-beta-2; 2.2-beta-1 uses
${artifactId}-${version}${dashClassifier?}.${extension}) The default
value is ${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}.

-- 
Wendy

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