Found a BUG in the digit(index) method in hudson.util.VersionNumber. The
item value never gets updated, so you only get the first entry back
regardless of the index.
On Monday, August 4, 2014 2:30:29 PM UTC+1, pallen wrote:
>
> Jenkins.getInstance().getUpdateCenter().getPlugin("p4"
> ).getInstalled().getPlugin().getWrapper().getVersion();
> gives: 1.0.10-SNAPSHOT (private-08/04/2014 14:27-pallen)
>
> Seems convoluted, but does the job.
>
> Thanks for the hint.
> Paul
>
> On Monday, August 4, 2014 2:21:49 PM UTC+1, pallen wrote:
>>
>> I can get this far...
>>
>> Jenkins.getInstance().getUpdateCenter().getPlugin("p4")
>>
>> but can't find a getWrapper()
>>
>> On Monday, August 4, 2014 1:57:08 PM UTC+1, Dominik Bartholdi wrote:
>>>
>>> As this should always match the plugin version, you can do something
>>> like this:
>>>
>>> *Jenkins.getUpdateCenter().getPlugin(“p4").getWrapper().getVersion()*
>>>
>>> …just out of my head - please check concrete method names…
>>>
>>> Domi
>>>
>>>
>>>
>>> On 04.08.2014, at 14:52, pallen <[email protected]> wrote:
>>>
>>> In my POM I specify the plugin's version, e.g.
>>>
>>> <artifactId>p4</artifactId>
>>>> <version>1.0.9</version>
>>>> <packaging>hpi</packaging>
>>>
>>>
>>>
>>> I would like to access the String "1.0.9" in my code; something like
>>> this:
>>>
>>>> this.getClass().getPackage().getImplementationVersion();
>>>
>>>
>>>
>>> I have tried adding the "maven-jar-plugin" as per
>>> http://stackoverflow.com/questions/3697449/retrieve-version-from-maven-pom-xml-in-code,
>>>
>>> but no luck. Is this a result of the HPI packaging?
>>>
>>> Kind regards,
>>>
>>> Paul
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.