You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by brajesh <ra...@cgu.com.au> on 2012/05/03 07:50:53 UTC

how to override artifact name while installing the artifact to repo ?

I am trying to override  a jar file name as follows with an underscore
between artifact name and version.

projectName_v1_0.jar

this is how we declare in pom.xml

<artifactId>projectName</artifactId>
<version>v1_0</version>
<packaging>jar</packaging>

during mvn clean install , this create the artifact as projectName-v1_0.jar
an hypen appended to the version. I want that to be a underscore. 

I tried to put the following inside the build tag 
<finalName>${artifactId}_${version}</finalName> 

and it created the artifact as projectName_v1_0.jar in the target folder.
however during the installation 
following happens

Installing C:\service-maven-projects\projectName\target\
projectName_v1_0.jar to
C:\Users\rrrrrr\.m2\repository\au\com\xxx\yyy\projectName\v1_0\projectName-v1_0.jar

Can any one advise me why this is happening ? can't i override the hyphen
generated during the installation of artifact ?


--
View this message in context: http://maven.40175.n5.nabble.com/how-to-override-artifact-name-while-installing-the-artifact-to-repo-tp5682313.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: how to override artifact name while installing the artifact to repo ?

Posted by Barrie Treloar <ba...@gmail.com>.
On Thu, May 3, 2012 at 3:20 PM, brajesh <ra...@cgu.com.au> wrote:
> I am trying to override  a jar file name as follows with an underscore
> between artifact name and version.
>
> projectName_v1_0.jar
>
> this is how we declare in pom.xml
>
> <artifactId>projectName</artifactId>
> <version>v1_0</version>
> <packaging>jar</packaging>
>
> during mvn clean install , this create the artifact as projectName-v1_0.jar
> an hypen appended to the version. I want that to be a underscore.
>
> I tried to put the following inside the build tag
> <finalName>${artifactId}_${version}</finalName>
>
> and it created the artifact as projectName_v1_0.jar in the target folder.
> however during the installation
> following happens
>
> Installing C:\service-maven-projects\projectName\target\
> projectName_v1_0.jar to
> C:\Users\rrrrrr\.m2\repository\au\com\xxx\yyy\projectName\v1_0\projectName-v1_0.jar
>
> Can any one advise me why this is happening ? can't i override the hyphen
> generated during the installation of artifact ?

Why are you fighting with Maven?
Please read the freely available books at http://maven.apache.org/articles.html

Do you understand the implications of this if you managed to get it to work?
e.g. If you change the name of the artifact in your repository, how do
you expect Maven to refind that artifact when it is referenced in a
different project?

If however, you want to rename the artifacts as they are bundled into
an assembly then see
http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html and
outputFileNameMapping

But generally you want the format that Maven uses for a reason that it
includes the version identifier for later identification purposes.

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


Re: how to override artifact name while installing the artifact to repo ?

Posted by Wayne Fay <wa...@gmail.com>.
> I am trying to override  a jar file name as follows with an underscore
> between artifact name and version.
...
> Can any one advise me why this is happening ? can't i override the hyphen
> generated during the installation of artifact ?

No.

Wayne

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


Re: how to override artifact name while installing the artifact to repo ?

Posted by Anders Hammar <an...@hammar.net>.
You can't change the name of the artifact deployed to the repository.
The Maven repository mandates a specific naming scheme.

/Anders

On Thu, May 3, 2012 at 7:50 AM, brajesh <ra...@cgu.com.au> wrote:
> I am trying to override  a jar file name as follows with an underscore
> between artifact name and version.
>
> projectName_v1_0.jar
>
> this is how we declare in pom.xml
>
> <artifactId>projectName</artifactId>
> <version>v1_0</version>
> <packaging>jar</packaging>
>
> during mvn clean install , this create the artifact as projectName-v1_0.jar
> an hypen appended to the version. I want that to be a underscore.
>
> I tried to put the following inside the build tag
> <finalName>${artifactId}_${version}</finalName>
>
> and it created the artifact as projectName_v1_0.jar in the target folder.
> however during the installation
> following happens
>
> Installing C:\service-maven-projects\projectName\target\
> projectName_v1_0.jar to
> C:\Users\rrrrrr\.m2\repository\au\com\xxx\yyy\projectName\v1_0\projectName-v1_0.jar
>
> Can any one advise me why this is happening ? can't i override the hyphen
> generated during the installation of artifact ?
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/how-to-override-artifact-name-while-installing-the-artifact-to-repo-tp5682313.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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