You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Neiman, Victor" <VN...@fnb.co.za> on 2015/11/11 08:53:00 UTC

Build Number Maven Plugin branch naming

Hi all,

Working on a project that generates RPM's using rpm-maven-plugin, the RPM's then have the build number appended to them using the buildnumber-maven-plugin. 

Currently using SVN. I would like to change the way $svnVersion is set for my branches. That is, I would like to shorten it a bit, currently my branch is located at 
http://<repo_ip>/repos/<project_name>/branches/dev/

I compile the RPM and add the build number using $svnVersion to get the following:
<rpm_name>-1.0-branches_dev_BuildModule_MainRPMs_Standalone_TerminalDriver.9057.noarch.rpm

so $svnVersion=branches_dev_BuildModule_MainRPMs_Standalone_TerminalDriver.9057

I understand that the reason for this is that the branch itself has the path /branches/dev/ and the RPM sources are located at /BuildModule/MainRPMs/Standalone/TerminalDriver.

What I'd like to get to is truncating the branch name to something like branches_dev, so the resulting RPM would be named
<rpm_name>-1.0-branches_dev.9057.noarch.rpm

So my question is whether there is a way I can manipulate $svnVersion somehow to make it @svnVersion=branches_dev, which is a substring of the original?

Regards and thanks
Vic
To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: 
https://www.fnb.co.za/disclaimer.html 

If you are unable to access the Disclaimer, send a blank e-mail to
firstrandbankdisclaimer@fnb.co.za and we will send you a copy of the Disclaimer.

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


Re: Build Number Maven Plugin branch naming

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Victor,

> I would like to change the way $svnVersion is set for my branches.
> That is, I would like to shorten it a bit

Not sure if the buildnumber-maven-plugin has a direct way, but the
build-helper-maven-plugin has a regex-property goal for manipulating
properties.


http://www.mojohaus.org/build-helper-maven-plugin/usage.html#Set_a_property_by_applying_a_regex_replacement_to_a_value

Here is an example usage:


https://github.com/scijava/pom-scijava/blob/pom-scijava-8.5.0/pom.xml#L1066-L1097

Regards,
Curtis


On Wed, Nov 11, 2015 at 1:53 AM, Neiman, Victor <VN...@fnb.co.za> wrote:

> Hi all,
>
> Working on a project that generates RPM's using rpm-maven-plugin, the
> RPM's then have the build number appended to them using the
> buildnumber-maven-plugin.
>
> Currently using SVN. I would like to change the way $svnVersion is set for
> my branches. That is, I would like to shorten it a bit, currently my branch
> is located at
> http://<repo_ip>/repos/<project_name>/branches/dev/
>
> I compile the RPM and add the build number using $svnVersion to get the
> following:
>
> <rpm_name>-1.0-branches_dev_BuildModule_MainRPMs_Standalone_TerminalDriver.9057.noarch.rpm
>
> so
> $svnVersion=branches_dev_BuildModule_MainRPMs_Standalone_TerminalDriver.9057
>
> I understand that the reason for this is that the branch itself has the
> path /branches/dev/ and the RPM sources are located at
> /BuildModule/MainRPMs/Standalone/TerminalDriver.
>
> What I'd like to get to is truncating the branch name to something like
> branches_dev, so the resulting RPM would be named
> <rpm_name>-1.0-branches_dev.9057.noarch.rpm
>
> So my question is whether there is a way I can manipulate $svnVersion
> somehow to make it @svnVersion=branches_dev, which is a substring of the
> original?
>
> Regards and thanks
> Vic
> To read FirstRand Bank's Disclaimer for this email click on the following
> address or copy into your Internet browser:
> https://www.fnb.co.za/disclaimer.html
>
> If you are unable to access the Disclaimer, send a blank e-mail to
> firstrandbankdisclaimer@fnb.co.za and we will send you a copy of the
> Disclaimer.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>