maybe u  can use

ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setProcessPlugins( false );
configuration.setRepositorySession( session );
org.apache.maven.artifact.Artifact artifact = new
org.apache.maven.artifact.DefaultArtifact(groupId, artifactId,
version, "compile", "", "", new DefaultArtifactHandler());MavenProject
project = projectBuilder.build(artifact, configuration).getProject();





On Mon, Aug 4, 2014 at 5:52 AM, 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.

Reply via email to