How to use ELK layout when we use a local plantuml server ?

0 votes
asked Feb 5 in Question / help by kasra (1,000 points)
edited Feb 5 by kasra

Hi,

with the elk-full.jar installed in the same folder of the plantuml.jar the following command does the job 

java -jar plantuml.jar -Playout=elk

But how to make use of !pragma layout elk when we use a local plantuml server ?

How should I pass the  -Playout=elk to the mvn command ?

Thanks

3 Answers

+1 vote
answered Feb 5 by kasra (1,000 points)
 
Best answer

puting the elk-full.jar under src/main/webapp/WEB-INF/lib ( under my plantuml-server folder )  worked for me 

commented Feb 15 by Steve
This is great, can you tell me how you got elk-full.jar? Was it through a maven process? Did you build it from https://github.com/eclipse/elk it's really not clear how I can get this jar, been trying to get this on and off but no luck.
commented Feb 15 by kasra (1,000 points)
I got it from documentation

https://plantuml.com/en/elk
0 votes
answered Feb 5 by Serge Wenger Work (15,620 points)

Add pragma just after startuml

@startuml
!pragma layout elk 
class a
class b
a -> b
@enduml

commented Feb 5 by kasra (1,000 points)

I know but this is not the question,

my question is about using elk with the plantuml local server.

when I use the pragma directive I got : 

java.lang.ClassNotFoundException : org.eclipse.elk.graph.util.ElkGraphUtil

when we use the java command the elk jar is in the same folder of the plantuml.jar.

But  I am using the local server, where should I put the elk jar ? 

Thanks.

commented Feb 5 by Serge Wenger Work (15,620 points)

Hello,

I have no more a local server, but I think you must put  elk-full.jar in  the same as the plantuml.war file in your tomcat (or other) server

commented Feb 5 by kasra (1,000 points)

Thanks man, you put me on the right path.

I am using jetty so I just added ( quick and dirty solution ) the elk-full.jar inside 

src/main/webapp/WEB-INF/lib ( under my plantuml-server folder ) 

commented Feb 15 by Steve
Sigh, ok thanks. Our company blocks downloads but we can get from maven central or I was thinking of building it from scratch. I've built the project from the github and generated some jars, I may try to just add those jars into the WEB-INF/lib and see if it is the set of jars combined into the elk-full.jar otherwise I'll have to ask the folks who put the jar together the steps they used to create the full one.
0 votes
answered Feb 10 by Allen (140 points)

When utilizing a local PlantUML server with ELK layout, you can follow these steps:

Set up and run a local PlantUML server on your machine.
Ensure that the ELK (Edge Labeling for Kubernetes) layout is enabled in your PlantUML configuration.
Write your PlantUML code as usual, specifying the desired layout using the ELK syntax.
Generate the diagram using the local keto pendent PlantUML server, which will apply the ELK layout to your diagram.
View and utilize the diagram with the ELK layout applied, providing clear and organized visualizations for your Kubernetes architecture.

...