maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Heinz Marbaise (JIRA)" <>
Subject [jira] [Commented] (MINVOKER-198) mavenOpts in does not accept parameters with spaces
Date Sun, 17 Jul 2016 12:57:20 GMT


Karl Heinz Marbaise commented on MINVOKER-198:

Thank you very much that I now have an example project which shows the issue and by which
I can reproduce the described behaviour...So I have dived into this more in depth...and based
on your {{}} example I see the problem. In your {{}} you do the following:
mvn clean asciidoctor:process-asciidoc -Dasciidoctor.sourceDirectory=src/main/doc -Dasciidoctor.outputDirectory=target/docs
-Dasciidoctor.attributes="toc=left source-highlighter=coderay"
which is not equivalent to:
export MAVEN_OPTS=-Dasciidoctor.attributes="toc=left source-highlighter=coderay"
mvn clean asciidoctor:process-asciidoc -Dasciidoctor.sourceDirectory=src/main/doc -Dasciidoctor.outputDirectory=target/docs
The first one works perfectly cause the {{-D...}} things are handled by Maven core (Java code)
whereas the second will not work cause {{MAVEN_OPTS}} is handled by the {{mvn}} shell script
where it does expect only settings for memory etc. and nothing else...
If you use for your integration test the {{}} like this:
invoker.goals=clean asciidoctor:process-asciidoc -Dasciidoctor.sourceDirectory=src/main/doc
-Dasciidoctor.outputDirectory=target/docs -Dasciidoctor.attributes="toc=left source-highlighter=coderay"
it will work cause it is equivalent to your {{}} script.
You can of course use line endings to make the invocation in the above more readable like
invoker.goals=clean asciidoctor:process-asciidoc \
   -Dasciidoctor.sourceDirectory=src/main/doc \
   -Dasciidoctor.outputDirectory=target/docs \
   -Dasciidoctor.attributes="toc=left source-highlighter=coderay"
This is equivalent with the usual usage on command line, cause defining cli parameters for
plugins into {{MAVEN_OPTS}} is not a good idea (as we see based on this). To be honest I would
have never got on the idea to do so..

The issue is based in the {{mvn}} script which handles no special cases in using {{MAVEN_OPTS}}.
But I don't see any chance to make this work with {{MAVEN_OPTS}} because it would result to
implement much logic into the start shell script / batch script (windwos)...which is in contradiction
to the line we are going to reduce the logic as much as possible in the start scripts.

> mavenOpts in does not accept parameters with spaces
> ----------------------------------------------------------------------
>                 Key: MINVOKER-198
>                 URL:
>             Project: Maven Invoker Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Maven 3.3.9 and 3.2.5.
> Linux/Mac
>            Reporter: Abel Salgado Romero
>             Fix For: waiting-for-feedback
>         Attachments: mac_output.txt
> Seems that mavenOpts does some additional parsing and comand line arguments with spaces
are not read correctly.
> This prevents writing tests that when run on console in a normal maven build they work.
> Here is an example of what I want to test:
> If you see the "asciidoctor.attributes" is a chain with many internal parameters and
spaces. This works on console, but not in the test.
> But the test fails with the message:
> Error: Could not find or load main class source-highlighter=coderay"

This message was sent by Atlassian JIRA

View raw message