Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doing calculations on properties

Tags:

maven-2

maven

Is it possible to do string and math operations on properties in maven 2?

I have a property ${version} that has a value of something like 5.3.0-SNAPSHOT, now I'd like to extract the 5 and do some math on it, say subtract 3 from it. So my new property would get the value 2.

like image 586
Andreas Wederbrand Avatar asked Dec 21 '11 08:12

Andreas Wederbrand


People also ask

How do you calculate property?

To estimate property values in the current market, divide the net operating income by the capitalization rate. For example, if the net operating income were $100,000 with a five percent cap rate, the property value would be roughly $2 million.

How do you calculate income from property production?

Gross rent multiplier (GRM) For example, if the property value is $162,000 and the gross rental income is $18,600, the GRM would be: GRM = property value or purchase price / gross rental income. $162,000 property value / $18,600 gross rental income = 8.7.

How is profit calculated on property sale in Singapore?

Calculating net sales proceeds from selling your property In order to calculate net sales proceeds, take the difference between the selling price and purchase of your property, and deduct all the costs you have incurred in the property transaction. ROI can be expressed as a percentage of the original value.


1 Answers

You may want to look at the parse-version goal of build helper maven plugin. As the example in this page indicates, once this goal is run, it makes available a bunch of propeties which can be used to do subsequent operations.

parsedVersion.majorVersion
parsedVersion.minorVersion
parsedVersion.incrementalVersion
parsedVersion.qualifier
parsedVersion.buildNumber
like image 101
Raghuram Avatar answered Sep 22 '22 17:09

Raghuram