I use the exec in the following way:

version=$(mvn -q -Dexec.executable=‘echo’ -Dexec.args=‘${project.version}’ 
--non-recursive exec:exec)

I hope this helps,

> On Apr 18, 2018, at 02:12, Thishani Lucas <[email protected]> wrote:
> 
> Hi Nipuni,
> 
> Is it feasible to read the property directly from the file system? For 
> example, we can get the project version from the file 
> META-INF/maven/${groupId}/${artifactId}/pom.properties of the jar.
> 
>> On Wed, Apr 18, 2018 at 11:06 AM, Nipuni Bhagya <[email protected]> wrote:
>> Hi,
>> 
>> Thanks for the quick response. 
>> 
>>> If you can run the shell script as a step in maven process, you can easily 
>>> pass the ${project.version} using exec-maven-plugin
>> 
>> Hi Amalka,
>> 
>> The issue is we run the script after maven process.
>>  
>>>> You can use xmlstarlet to read the version of the project without adding a 
>>>> maven plugin to POM file. I used this to read XML values in the command 
>>>> line. An example can be found here [2]
>>>> 
>>>> [1]: http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html
>>>> [2]: https://stackoverflow.com/questions/12640152/xmlstarlet-select-value
>> 
>> Hi Abimaran,
>> 
>> It was initially decided not to use any external tools for this task. So we 
>> will need an approach which does not require any external XML tools.
>> 
>> -- 
>> Kind Regards,
>> 
>> Nipuni Bhagya
>> Software Engineering Intern
>> WSO2
>> Mobile : +94 0779028904
>> 
>> 
>> 
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>> 
> 
> 
> 
> -- 
> Regards,
> 
> Thishani Lucas
> Software Engineer 
> WSO2 Lanka (Private) Limited: http://wso2.com
> lean.enterprise.middle-ware
> 
> Tel: +94 77 2556931 
> LinkedIn: https://www.linkedin.com/in/thishani-lucas/
> 
> 
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to