You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Radosław Kozłowski <ra...@seamless.se> on 2009/03/12 13:51:32 UTC

How to keep the original file name during installation/deployment?

Hello,

for some of our projects we generate RPM packages during the package
phase. These RPM files are later on attached for installation and
deployment using a small plugin we wrote. The problem is, the name of
those RPM files intentionally does not follow the (Maven) convention of
${project.artifactId}-${project.version}.rpm, but uses prefixes and
suffixes that we require (some of them commonly found in the RPM world,
like .el5.x86_64(.rpm) or .noarch(.rpm)). However, during mvn install or
mvn deploy, the final name of the rpm package is changed back to
${project.artifactId}-${project.version}.rpm, which hides some important
details that we would like to keep.

To illustrate on example:

[...]
[INFO] [util:attach {execution: default}]
[INFO] Attaching:/home/radek/workspace/project-2.3.0-1/target/rpm/RPMS/noarch/group-project-2.3.0.1-16287.noarch.rpm
[INFO] [install:install]
[INFO] Installing /home/radek/workspace/project-2.3.0-1/pom.xml to /home/radek/.m2/repository/com/seamless/group/project/2.3.0-1/project-2.3.0-1.pom
[INFO] Installing /home/radek/workspace/project-2.3.0-1/target/rpm/RPMS/noarch/group-project-2.3.0.1-16287.noarch.rpm to /home/radek/.m2/repository/com/seamless/group/project/2.3.0-1/project-2.3.0-1.rpm
[...]

As you can see, the file group-project-2.3.0.1-16287.noarch.rpm is
installed as project-2.3.0-1.rpm. Is there a way to prevent this, ie.
keep the original file name?

Note that we would like that only for RPM packages (not even pom files),
because we don't use them as dependencies in our mavenized projects. We
don't want to change file names of artifacts of other types to not break
the dependency resolution.

Thanks,
Radek

Re: How to keep the original file name during installation/deployment?

Posted by zav <xa...@free.fr>.
Wayne Fay wrote
> 
> Classifiers are "the Maven way" to handle this. What more do you want,
> or why is this not sufficient?
> 

Ok, but in Radoslaw exemple, with a <classifier>noarch</classifier> it would
install:

group-project-2.3.0-1-noarch.rpm 
instead of:
group-project-2.3.0-1.noarch.rpm 

I have the same issue. Radoslaw, did you manage to solve it?

Cheers,
Xavier

--
View this message in context: http://maven.40175.n5.nabble.com/How-to-keep-the-original-file-name-during-installation-deployment-tp118901p5123191.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 keep the original file name during installation/deployment?

Posted by Wayne Fay <wa...@gmail.com>.
> I know maven is quite java centric, but I assume there should be some
> strategy for handling this type of problem in the "maven way"?
> What would be the proper way for accomplishing this in maven?

> 2009/3/12 Wayne Fay <>
>> If you require this naming you've suggested above, the -16287 part
>> belongs in your version tag, and the noarch bit belongs in the
>> classifier. Then Maven will install this file as:
>> ${project.artifactId}-${project.version}-${project.classifier}.rpm

Classifiers are "the Maven way" to handle this. What more do you want,
or why is this not sufficient?

Wayne

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


Re: How to keep the original file name during installation/deployment?

Posted by Kent Närling <ke...@seamless.se>.
I know maven is quite java centric, but I assume there should be some
strategy for handling this type of problem in the "maven way"?
What would be the proper way for accomplishing this in maven?


2009/3/12 Wayne Fay <wa...@gmail.com>

> > As you can see, the file group-project-2.3.0.1-16287.noarch.rpm is
> > installed as project-2.3.0-1.rpm. Is there a way to prevent this, ie.
> > keep the original file name?
>
> I'm not aware of any way to force Maven to install into a repo using
> the "finalName" you've defined. There are a lot of good reasons for
> this.
>
> If you require this naming you've suggested above, the -16287 part
> belongs in your version tag, and the noarch bit belongs in the
> classifier. Then Maven will install this file as:
> ${project.artifactId}-${project.version}-${project.classifier}.rpm
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Kent Närling

System Architect
SEAMLESS
Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
Phone: +46 8 5648 7800, fax: +46 8 5648 7823
Mobile: +46 70 836 9925
Mail: kent.narling@seamless.se
www.seamless.se

Re: How to keep the original file name during installation/deployment?

Posted by Wayne Fay <wa...@gmail.com>.
> As you can see, the file group-project-2.3.0.1-16287.noarch.rpm is
> installed as project-2.3.0-1.rpm. Is there a way to prevent this, ie.
> keep the original file name?

I'm not aware of any way to force Maven to install into a repo using
the "finalName" you've defined. There are a lot of good reasons for
this.

If you require this naming you've suggested above, the -16287 part
belongs in your version tag, and the noarch bit belongs in the
classifier. Then Maven will install this file as:
${project.artifactId}-${project.version}-${project.classifier}.rpm

Wayne

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