output directory flag is no longer working 1.2020.11 bug

0 votes
asked Jun 2, 2020 in Bug by chris (2,580 points)
This does not work anymore:

java -jar %~dp0\plantuml\plantuml.jar -o diagrams source\*.diag

Platform: windows

Files are always placed in the source folder with the uml code. I have tried using quotes, double backslash absolute names, relative directory paths (to the source), relative paths (to working directory) etc. I have also tried with a .puml extension, no joy.
commented Jun 2, 2020 by chris (2,580 points)
Ah, one more comment - the above is from a batch file but I have verified this also does not work without the ~dp0 bit on the command line. The last version I was using was 2020.9 where this was working.

1 Answer

0 votes
answered Jun 2, 2020 by plantuml (295,000 points)
Best answer
It may be related to https://plantuml.com/security


For example:

java -DPLANTUML_SECURITY_PROFILE=UNSECURE -jar /path/to/plantuml.jar ...

Tell us if it's working this way
commented Jun 3, 2020 by chris (2,580 points)
Hi, thanks for your quick response! No, I'm afraid this does not change the output directory
commented Jun 3, 2020 by chris (2,580 points)
I have just checked my java version, I have just noted I am using OpenJDK - could that be the issue? v14.0.1 (64bit), Windows10

The WHITELIST -Dplantuml.include.path option also results in "no diagram found" if I try to use that so it would seem none of this is working with my set up
commented Jun 3, 2020 by plantuml (295,000 points)
With last beta http://beta.plantuml.net/plantuml.jar the "-o" flag should be working back.

Tell us if it's not working for you!
commented Jun 4, 2020 by chris (2,580 points)
Hi, not quite, this is now outputting the files into another directory, but the relative path is now being created with respect to the source directory, rather than the working directory. For example, the batch file below should result in a source and target directory, as siblings, with diagrams created in "target". What actually happens is the diagrams are output into a new folder "source\target".

cd /d %~dp0
mkdir source
mkdir target

echo @startuml > source\beta_test.puml
echo "[*] -> State1" >> source\beta_test.puml
echo @enduml >> source\beta_test.puml

java -DPLANTUML_SECURITY_PROFILE=UNSECURE -jar plantuml.jar -o target source\*.puml
commented Jun 4, 2020 by plantuml (295,000 points)

In that case, you have to specify a full path (and not a relative one) :

java -DPLANTUML_SECURITY_PROFILE=UNSECURE -jar plantuml.jar -o c:\path\to\target source\*.puml

It's a subtle difference :-)

commented Jun 7, 2020 by chris (2,580 points)
Great, thanks for sorting - and not a problem to switch to using full paths, especially as this is due to a security improvement. Thanks team-plantuml :-)