Ok, this one is more complex.
The real issue comes from the fact that PlantUML language has been defined in a continuous and experimental way, and that leads sometimes to some inconsistency. Now I think it’s time to set it clearly.
At the beginning, there were only classes and packages.
Then, at some moment, we have added new package styles (node, folder...) and at that time, the best option, was to use UML stereotype. So in classes diagram can have:
package foo <<node>> {
class bar
}
Now that we are starting to implement deployment diagram http://plantuml.com/deployment-diagram , it sounds more logical to use specific keywords (node, folder...) rather than stereotypes. So you can write:
node foo {
artifact bar
}
Even if you cannot (yet) mix class diagram and deployment diagram, large portion of internal PlantUML code are common between both diagram types (and that drives to strange behaviour, as you have noticed).
I am wondering if we should not change the syntax for classes diagram, remove the ability to change style of package through stereotype, and let the new syntax be:
node foo {
class bar
}
This is not mandatory (we could fix your issue without doing this) but maybe situation will be more simple for users that way.
One drawback is that this somehow breaks ascending compatibility (newer version of PlantUML would not apply styles on "old" diagrams that uses stereotypes). It may be acceptable, as diagrams will still be displayed (and style, even if not applied, would be displayed as Stereotype).
We are still thinking about all this, so any idea/suggestion is welcome!