Commande line output directory do not work when using relativ path

0 votes
asked Mar 12, 2013 in Bug by anonymous

Hi !

I did not find a real bug tracker, so I post here, if there is one, tell me and I will move my question there.

My problem is with the output directory parameter with the command line. I have the following structure

  • src/*.txt
  • target/png/

My goal is to generate all the diagrams in png format in the directory in target. I use the following command :

java -jar bin/plantuml.jar -o "./target/png" "./src"

The files are generated in the folder src/png, and not in /target/png.

Additional informations :

  • This work when I use absolute path
  • It does the same things on windows and unix
  • PlantUML version 7959 (Thu Feb 28 18:59:31 CET 2013)
  • If I set the output directory to "./target", it create the files in /src/target

 

Do no hesitate if you want more information.

 

Victor.

1 Answer

0 votes
answered Mar 15, 2013 by plantuml (294,960 points)

Ok, we have made a fix, and you can download (and test) the patched version: http://dl.dropbox.com/u/13064071/plantuml.jar

Note that for what you are trying to do, you should use:

java -jar bin/plantuml.jar -verbose -o "../target/png" "./src"

../target/png  instead of ./target/png

The reason why is that the output directory (-o) is NOT relative to the current directory where you launch the command,
but relative to the directory that contains the diagram sources (that is, ./src in your example, and that's why we have to add ..)

This is usefull when you have a deep structure of files, like for example:

  • src/foo1/*.txt
  • src/foo2/*.txt


In that case, if you launch:

java -jar plantuml.jar -verbose -o "./target/png" "./src/**.txt"

You will get as result:

  • src/foo1/target/png/*.png
  • src/foo2/target/png/*.png

If you want to have all images if the very same directory, you do have to use a absolute path:

java -jar plantuml.jar -verbose -o "/tmp/target/png" "./src/**.txt"

This sound a bit strange, but this allows a high flexibiliy, depending on what people want to do.

If you find other issues, or have suggestion, please go ahead,

Regards,

...