Am 2023-02-09 um 15:38 schrieb Christoph Läubrich:
I have a question on this statement below that -D has not to go into maven.config but in jvm config.

No, this is wrong and I didn't say that.

I think the difference is more that -D in jvm.config become a "real" system-property (because it is evaluated before maven jvm start up), but -D options specified in maven.config actually become user-propertties AND "soft" systemproperties (as they are set after the JVM has started) see the following code:

https://github.com/apache/maven/blob/master/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L1465-L1492

So -D is a valid JVM option AND a valid mvn commandline option (named SET_USER_PROPERTY == -D)

Also https://maven.apache.org/ref/3.9.0/maven-embedder/cli.html mention -D as a cli option!

Actually, no. The real problem is https://github.com/apache/maven/blob/7b38457506544854cdd26aa1d49608050217b923/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L1494-L1503.

Java system properties != Maven user properties. It is unfortunate, for historical reasons, that both have been mixed. You cannot reliably set a system property *after* 'mvn'. Some will not even be effective. Slawek and me are working on cleaning this up in the future. Therefore, I have clearly renamed the help output in Maven to denote that those are user properties and *not* system properties. It is also unfortunate that Maven uses '-D' for this, I would have preferred '-P', but this is taken already.

Also prior to 3.9.x the contents of the file was split by *any* space see:
https://github.com/apache/maven/blob/maven-3.8.x/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L380-L399

Also reading this I can't find a indication that new lines are required:
https://maven.apache.org/configure.html

You also can't find the opposite. There is no formal specification. That is the real problem. We have failed to provide clear instructions for both config -- rather opts -- files.

Am 31.01.23 um 16:00 schrieb Michael Osipov:
Am 2023-01-31 um 01:35 schrieb Dan Tran:
run into this issue

"Unable to parse maven.config file options: Unrecognized maven.config file
entries: [ -e --fail-fast -Djavax.xml.accessExternalSchema=all
-Daether.connector.resumeDownloads=false]"

The workaround is to break it into multiple lines

This is not a workaround. Your input is wrong in two ways:

1. Each arg has to be in one line: https://gitbox.apache.org/repos/asf?p=maven.git;a=commit;h=331c5c3435cdfa8dc3f35a7b38503bdac2654206 2. Java system props must *not* be passed via maven.config, but via MAVEN_OPTS or jvm.config only, e.g., -Djavax.xml.accessExternalSchema=all

M


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org


Reply via email to