How to generate package diagram with nested packages which may contain same names in different levels?

0 votes
asked Nov 3, 2017 in To be sorted by vivodo (120 points)
I use a script to generate package diagrams with hierarchical packages which may contain duplicated names but not in the same levels. e.g.:

@startuml
package A {
    package B {
        package C
    }
    package A
}
@enduml

I think, package A.A might be acceptable. But plantuml failed with this error: Thie element (A) is already defined.

I also try the following:

@startuml
folder A {
    folder B {
        folder C
    }
    folder A
}
@enduml

Then, plantuml failed with the same error. I tried namespace instead of folder, then failed with the same error.

1 Answer

0 votes
answered Nov 3, 2017 by Serge Wenger Work (10,640 points)
edited Nov 3, 2017 by Serge Wenger Work

Hello,

You can use the as keyword. There is still a display bug on the "leaf" package

@startuml
package  "A" as RootA {
    package  B {
        package  C
    }
' display bug
    package  "A" as AA 
    package  "A" as AAA {
    File z
    }
}
@enduml

...