I have a question on this statement below that -D has not to go into maven.config but in jvm config.

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!

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



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