plsql-formatter-settings: Building native image on Windows 11 - mvn failure

Hi @PhilippSalvisberg

I have followed your instructions for building native image but when running it on Windows 11 platform I face some issues,

I run the command from windows CMD.

C:\Users\JacekGebal\DataGripProjects\plsql-formatter-settings\standalone>mvn -X -Dskip.native=false -DskipTests=true -Ddisable.logging=true clean package > clean_package.log

See the clean_package.log file for full log.

The error is:

Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 109: C:\Users\JacekGebal\DataGripProjects\plsql-formatter-settings\standalone\target/tvdformat-22.2.2-SNAPSHOT.jar:C:\Users\JacekGebal\.m2\repository/oracle/dbtools/dbtools-common/22.2.1/dbtools-common-22.2.1.jar:C:\Users\JacekGebal\.m2\repository/org/reflections/reflections/0.10.2/reflections-0.10.2.jar:C:\Users\JacekGebal\.m2\repository/org/javassist/javassist/3.29.0-GA/javassist-3.29.0-GA.jar:C:\Users\JacekGebal\.m2\repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:C:\Users\JacekGebal\.m2\repository/org/slf4j/slf4j-jdk14/1.7.36/slf4j-jdk14-1.7.36.jar:C:\Users\JacekGebal\.m2\repository/org/graalvm/js/js-scriptengine/22.2.0/js-scriptengine-22.2.0.jar

It could be due to a mix of windows style \ and linux/mac style / path delimiters in the path as mentioned here

Do you have any suggestion on how to solve this?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Seems that copy & paste of formatter.js file from sqlcl to standalone/src/main/resourece did the trick.

https://github.com/Trivadis/plsql-formatter-settings/blob/sqlcl-22.2.1/standalone/src/main/resources/format.js is a symbolic link.

Should work under Windows. But not per default. See https://github.com/git-for-windows/git/wiki/Symbolic-Links for more information.

I’ve run git clone -c core.symlinks=true https://github.com/Trivadis/plsql-formatter-settings.git as Administrator in a command window. Works.

Is the solution for issue https://github.com/Trivadis/plsql-formatter-settings/issues/228 provided in https://github.com/Trivadis/plsql-formatter-settings/pull/231 applicable for native image?

Yes. It should work out-of-the box.

And it actually formats.

PS C:\Users\JacekGebal\DataGripProjects\plsql-formatter-settings\standalone\target> .\tvdformat.exe scratch_1.json ext=sql,prc,fnc,pks,pkb,trg,vw,tps,tpb,tbp,plb,pls,rcv,spc,typ,aqt,aqp,ctx,dbl,tab,dim,snp,con,collt,seq,syn,grt,sp,spb,sps,pck mext=markdown,mdown,mkdn,md xml=trivadis_advanced_format.xml arbori=trivadis_custom_format.arbori

Formatting file 1 of 2: IMPEXP_CONFIGURATION_TO_CSV.pkb... done.
Formatting file 2 of 2: IMPEXP_CONFIGURATION_TO_CSV.pks... done.
PS C:\Users\JacekGebal\DataGripProjects\plsql-formatter-settings\standalone\target>

The start-up speed is amazing!

Not it can be used as a pre-commit hook actually.

Looks like comma (,) works The <classpath> property is defined as java.util.List(String)

                                    <classpath>
                                        ${project.build.directory}${file.separator}${project.build.finalName}.jar,${settings.localRepository}${file.separator}oracle${file.separator}dbtools${file.separator}dbtools-common${file.separator}${sqlcl.version}${file.separator}dbtools-common-${sqlcl.version}.jar,${settings.localRepository}${file.separator}org${file.separator}reflections${file.separator}reflections${file.separator}${reflections.version}${file.separator}reflections-${reflections.version}.jar,${settings.localRepository}${file.separator}org${file.separator}javassist${file.separator}javassist${file.separator}${javassist.version}${file.separator}javassist-${javassist.version}.jar,${settings.localRepository}${file.separator}org${file.separator}slf4j${file.separator}slf4j-api${file.separator}${slf4j.version}${file.separator}slf4j-api-${slf4j.version}.jar,${settings.localRepository}${file.separator}org${file.separator}slf4j${file.separator}slf4j-jdk14${file.separator}${slf4j.version}${file.separator}slf4j-jdk14-${slf4j.version}.jar,${settings.localRepository}${file.separator}org${file.separator}graalvm${file.separator}js${file.separator}js-scriptengine${file.separator}${graalvm.version}${file.separator}js-scriptengine-${graalvm.version}.jar
                                    </classpath>