I believe the -D option noted was one that was not related to maven itself but 
rather jvm.  We use -D there for very specific maven item only and its fine.  
The new lines are required for sure both in 3.9.0 and 4.0.0 alphas.  We have 
already scaled this out as an automated change where I work to address the 
maven.config at some time maven bumps up via maven wrapper settings.  To be 
more specific, we are using 
-Daether.checksums.algorithms=SHA512,SHA-256,SHA-1,MD5 in the maven.config as 
only -D in our case.  I have many OSS projects too that have that same setup.  
Sure that also works moving it into jvm.config but its very maven specific so 
it makes more sense in maven.config IMHO.

-----Original Message-----
From: Christoph Läubrich <m...@laeubi-soft.de> 
Sent: Thursday, February 9, 2023 9:39 AM
To: dev@maven.apache.org
Subject: maven.config / jvm.config / -D options

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://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fmaven%2Fblob%2Fmaster%2Fmaven-embedder%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fmaven%2Fcli%2FMavenCli.java%23L1465-L1492&data=05%7C01%7C%7C0e31227901824ea3f55008db0aab6565%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638115503525180590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pqVdZ%2BxaeNpj83ER5ri%2FFpVKKN8MRvYaUd8C%2BgtdQaA%3D&reserved=0

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

Also 
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmaven.apache.org%2Fref%2F3.9.0%2Fmaven-embedder%2Fcli.html&data=05%7C01%7C%7C0e31227901824ea3f55008db0aab6565%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638115503525180590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=h8qBkhxbZXPCpYmmyfsKLnTpbGc0qxEgsI5IHDulW0w%3D&reserved=0
 mention -D as a cli option!

Also prior to 3.9.x the contents of the file was split by *any* space see:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fmaven%2Fblob%2Fmaven-3.8.x%2Fmaven-embedder%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fmaven%2Fcli%2FMavenCli.java%23L380-L399&data=05%7C01%7C%7C0e31227901824ea3f55008db0aab6565%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638115503525180590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=roUc9kOUHcO8R2%2FoYpCGkfy6WLTP5T3bE2s4c2T0b5Q%3D&reserved=0

Also reading this I can't find a indication that new lines are required:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmaven.apache.org%2Fconfigure.html&data=05%7C01%7C%7C0e31227901824ea3f55008db0aab6565%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638115503525180590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FC4oKQzRScoPPlk4rWIqAfI577SEZ9jrSLaqxRdRMgA%3D&reserved=0



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://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbo
> x.apache.org%2Frepos%2Fasf%3Fp%3Dmaven.git%3Ba%3Dcommit%3Bh%3D331c5c34
> 35cdfa8dc3f35a7b38503bdac2654206&data=05%7C01%7C%7C0e31227901824ea3f55
> 008db0aab6565%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63811550352
> 5180590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLC
> JBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GVnU8ToabKngYqsv3Rm
> T5On4r7WyglQuT19XlPwdlYk%3D&reserved=0
> 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


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

Reply via email to