If you can run the shell script as a step in maven process, you can easily
pass the ${project.version} using exec-maven-pluginOn Wed, Apr 18, 2018 at 9:36 AM, Abimaran Kugathasan <[email protected]> wrote: > Hi Nipuni, > > 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 > > On Tue, Apr 17, 2018 at 2:37 PM, Nipuni Bhagya <[email protected]> wrote: > >> Hi all, >> >> I have encountered a problem while trying to get the version number of a >> jar into a shell script. Currently, the name of the jar is hardcoded in the >> script. But the problem is when the maven version get updated in the >> project it should reflect in the script. The closest solution I have come >> up at the moment is to use the Maven Help Plugin >> <http://maven.apache.org/plugins/maven-help-plugin/>. The >> goal help:evaluate can evaluate Maven expression, >> -Dexpression=project.version and then I can grep the version from its >> result. >> >> I would really appreciate if someone of you could help me to find a >> better way to achieve this task. >> >> Thank you in advance, >> >> -- >> >> >> >> *Kind Regards,Nipuni Bhagya* >> >> *Software Engineering Intern* >> *WSO2* >> >> >> >> *Mobile : +94 0779028904 <+94%2077%20767%201807>* >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Thanks > Abimaran Kugathasan > Senior Software Engineer - API Technologies > > Email : [email protected] > Mobile : +94 773922820 > > <http://stackoverflow.com/users/515034> > <http://lk.linkedin.com/in/abimaran> > <http://www.lkabimaran.blogspot.com/> <https://github.com/abimarank> > <https://twitter.com/abimaran> > > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Amalka Subasinghe WSO2 Inc. https://wso2.com/ Mobile: +94 77 9401267
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
