Re: maven-exec-plugin problem

2019-07-05 Thread Mirko Friedenhagen
You could try the exec-maven-plugin approach and use mvn -N to restrict the 
execution to the reactor parent *if* all your reactor modules have the same 
version.

Concerning the help-Plugin : forceStdout is a very recent feature, you need at 
least version 3.1.0, try:
mvn -N -q org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate 
-DforceStdout -Dexpression=project.version

Best Regards 
Mirko Friedenhagen
— 
Sent from my mobile 

Am 02.07.19 um 14:39 schrieb 'Jörg Hohwiller' via mojohaus-dev

> Hi,
> 
> it is not even ci-friendly. I have the version configured statically in 
> that project:
> https://github.com/devonfw-forge/keywi/blob/master/pom.xml#L7
> 
> Not a clue what is going wrong with help-plugin in this setup...
> Any hit to shed a light would be highly appreciated...
> 
> Cheers
>   Jörg
> 
> Am Dienstag, 2. Juli 2019 14:37:32 UTC+2 schrieb Jörg Hohwiller:
> >
> > Hi again,
> >
> > as always murphies law applies.
> > # git clone https://github.com/devonfw-forge/keywi.git
> > # mvn help:evaluate -Dexpression=project.version -q -DforceStdout
> > # mvn -q exec:exec -Dexec.executable=echo -Dexec.args='${project.version}'
> > 1.0.0-SNAPSHOT
> > 1.0.0-SNAPSHOT
> > 1.0.0-SNAPSHOT
> > 1.0.0-SNAPSHOT
> > 1.0.0-SNAPSHOT
> > #
> >
> > So do not ask me why but IMHO help:evaluate does not work together with 
> > ci-fiendly-maven (https://maven.apache.org/maven-ci-friendly.html).
> >
> > Is that a bug of maven-help-plugin?
> > Or is there anything I can do about it?
> >
> > Thanks
> >   Jörg
> >
> > Am Dienstag, 2. Juli 2019 14:18:18 UTC+2 schrieb Jörg Hohwiller:
> >>
> >> Hi Alexei,
> >>
> >> Awesome!
> >> This does not solve all my problems as I need to check for a convergent 
> >> version (excluding potential "dev-SNAPSHOT" version of parents that do not 
> >> get released) throughout the reactor of a multi-module project but you 
> >> gave 
> >> me the right hint and missing link to get it done.
> >>
> >> Thank you so much
> >>   Jörg
> >>
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "mojohaus-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojohaus-dev+unsubscr...@googlegroups.com.
> To post to this group, send email to mojohaus-dev@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojohaus-dev/3985cba0-2f5c-4d24-a7c4-9c024a24c221%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"mojohaus-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojohaus-dev+unsubscr...@googlegroups.com.
To post to this group, send email to mojohaus-dev@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojohaus-dev/trinity-b2948cd5-6109-4fa8-bd3f-05a4731ed15c-1562101784915%40msvc-mesg-gmx122.
For more options, visit https://groups.google.com/d/optout.


Re: maven-exec-plugin problem

2019-07-02 Thread 'Jörg Hohwiller' via mojohaus-dev
Hi,

it is not even ci-friendly. I have the version configured statically in 
that project:
https://github.com/devonfw-forge/keywi/blob/master/pom.xml#L7

Not a clue what is going wrong with help-plugin in this setup...
Any hit to shed a light would be highly appreciated...

Cheers
  Jörg

Am Dienstag, 2. Juli 2019 14:37:32 UTC+2 schrieb Jörg Hohwiller:
>
> Hi again,
>
> as always murphies law applies.
> # git clone https://github.com/devonfw-forge/keywi.git
> # mvn help:evaluate -Dexpression=project.version -q -DforceStdout
> # mvn -q exec:exec -Dexec.executable=echo -Dexec.args='${project.version}'
> 1.0.0-SNAPSHOT
> 1.0.0-SNAPSHOT
> 1.0.0-SNAPSHOT
> 1.0.0-SNAPSHOT
> 1.0.0-SNAPSHOT
> #
>
> So do not ask me why but IMHO help:evaluate does not work together with 
> ci-fiendly-maven (https://maven.apache.org/maven-ci-friendly.html).
>
> Is that a bug of maven-help-plugin?
> Or is there anything I can do about it?
>
> Thanks
>   Jörg
>
> Am Dienstag, 2. Juli 2019 14:18:18 UTC+2 schrieb Jörg Hohwiller:
>>
>> Hi Alexei,
>>
>> Awesome!
>> This does not solve all my problems as I need to check for a convergent 
>> version (excluding potential "dev-SNAPSHOT" version of parents that do not 
>> get released) throughout the reactor of a multi-module project but you gave 
>> me the right hint and missing link to get it done.
>>
>> Thank you so much
>>   Jörg
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"mojohaus-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojohaus-dev+unsubscr...@googlegroups.com.
To post to this group, send email to mojohaus-dev@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojohaus-dev/3985cba0-2f5c-4d24-a7c4-9c024a24c221%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: maven-exec-plugin problem

2019-07-02 Thread 'Jörg Hohwiller' via mojohaus-dev
Hi again,

as always murphies law applies.
# git clone https://github.com/devonfw-forge/keywi.git
# mvn help:evaluate -Dexpression=project.version -q -DforceStdout
# mvn -q exec:exec -Dexec.executable=echo -Dexec.args='${project.version}'
1.0.0-SNAPSHOT
1.0.0-SNAPSHOT
1.0.0-SNAPSHOT
1.0.0-SNAPSHOT
1.0.0-SNAPSHOT
#

So do not ask me why but IMHO help:evaluate does not work together with 
ci-fiendly-maven (https://maven.apache.org/maven-ci-friendly.html).

Is that a bug of maven-help-plugin?
Or is there anything I can do about it?

Thanks
  Jörg

Am Dienstag, 2. Juli 2019 14:18:18 UTC+2 schrieb Jörg Hohwiller:
>
> Hi Alexei,
>
> Awesome!
> This does not solve all my problems as I need to check for a convergent 
> version (excluding potential "dev-SNAPSHOT" version of parents that do not 
> get released) throughout the reactor of a multi-module project but you gave 
> me the right hint and missing link to get it done.
>
> Thank you so much
>   Jörg
>

-- 
You received this message because you are subscribed to the Google Groups 
"mojohaus-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojohaus-dev+unsubscr...@googlegroups.com.
To post to this group, send email to mojohaus-dev@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojohaus-dev/8ca044bc-ef57-4381-b1fb-fcced3f61231%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: maven-exec-plugin problem

2019-07-02 Thread 'Jörg Hohwiller' via mojohaus-dev
Hi Alexei,

Awesome!
This does not solve all my problems as I need to check for a convergent 
version (excluding potential "dev-SNAPSHOT" version of parents that do not 
get released) throughout the reactor of a multi-module project but you gave 
me the right hint and missing link to get it done.

Thank you so much
  Jörg

-- 
You received this message because you are subscribed to the Google Groups 
"mojohaus-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojohaus-dev+unsubscr...@googlegroups.com.
To post to this group, send email to mojohaus-dev@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojohaus-dev/61ba0eee-1bf5-402a-8c3d-2924b652c1bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: maven-exec-plugin problem

2019-06-30 Thread Alexei Znamensky
Hi Jörg,

You will want to:

mvn help:evaluate -Dexpression=project.version -q -DforceStdout

as prescribed in 
https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html

Cheers,
Alexei

On Monday, July 1, 2019 at 9:38:41 AM UTC+12, Jörg Hohwiller wrote:
>
> Hi there,
> in order to determine the version(s) of a maven project, several answers 
> on stackoverflow, etc. lead to calling:
> mvn -q exec:exec -Dexec.executable=echo -Dexec.args='${project.version}'
>
> However, if in case the maven project (or one of its modules) itself has 
> the maven-exec-plugin configured in its build section, the above command 
> fails.
> For some reason here maven tries to invoke that exec-plugin execution as 
> well and ends up with some error like:
>
> [ERROR] Unknown lifecycle phase "1.0.0-beta1-SNAPSHOT". You must specify a 
> valid lifecycle phase or a goal in the format : or 
> :[:]:. Available 
> lifecycle phases are: validate, initialize, generate-sources, 
> process-sources, generate-resources, process-resources, compile, 
> process-classes, generate-test-sources, process-test-sources, 
> generate-test-resources, process-test-resources, test-compile, 
> process-test-classes, test, prepare-package, package, pre-integration-test, 
> integration-test, post-integration-test, verify, install, deploy, 
> pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> 
> [Help 1]
> ...
> [ERROR] Command execution failed.
> org.apache.commons.exec.ExecuteException: Process exited with an error: 1 
> (Exit value: 1)
> at org.apache.commons.exec.DefaultExecutor.executeInternal 
> (DefaultExecutor.java:404)
> at org.apache.commons.exec.DefaultExecutor.execute 
> (DefaultExecutor.java:166)
> at org.codehaus.mojo.exec.ExecMojo.executeCommandLine 
> (ExecMojo.java:804)
>
> Is there some smart guy out there who could give me a hint how to avoid 
> this error (stop maven from executing the build execution of exec plugin 
> triggered from "mvn exec:exec" call)?
> Or as an alternative give me a better hint how to determine the version of 
> the current maven project from bash without manually parsing 
> ./mvn/maven.config as well as pom.xml files, etc. ending up in 
> reimplementing maven...
>
> Thanks
>   Jörg
>

-- 
You received this message because you are subscribed to the Google Groups 
"mojohaus-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojohaus-dev+unsubscr...@googlegroups.com.
To post to this group, send email to mojohaus-dev@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojohaus-dev/65d8496f-90fe-4079-a4f0-9bb617dae775%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.