updated pom repository tag to change the name & id and structurizr version update

This commit is contained in:
amit.pandey 2020-06-28 19:20:41 +05:30
parent 64b750ab78
commit 588ce9c663
3 changed files with 27 additions and 9 deletions

View File

@ -16,14 +16,14 @@
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<id>spring-release</id>
<name>Spring Release</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>true</enabled>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
<enabled>true</enabled>
</releases>
</repository>
</repositories>

View File

@ -42,7 +42,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<structurizr.version>1.0.0-RC5</structurizr.version>
<structurizr.version>1.0.0</structurizr.version>
</properties>
</project>

View File

@ -2,6 +2,8 @@ package com.baeldung.structurizr;
import java.io.File;
import java.io.StringWriter;
import java.util.HashSet;
import java.util.Set;
import com.structurizr.Workspace;
import com.structurizr.analysis.ComponentFinder;
@ -40,15 +42,31 @@ public class StructurizrSimple {
addContainers(workspace);
addComponents(workspace);
addSpringComponents(workspace);
exportToPlantUml(workspace.getViews().getViewWithKey(SOFTWARE_SYSTEM_VIEW));
exportToPlantUml(workspace.getViews().getViewWithKey(CONTAINER_VIEW));
exportToPlantUml(workspace.getViews().getViewWithKey(COMPONENT_VIEW));
exportToPlantUml(findViewWithKey(workspace.getViews(), SOFTWARE_SYSTEM_VIEW));
exportToPlantUml(findViewWithKey(workspace.getViews(), CONTAINER_VIEW));
exportToPlantUml(findViewWithKey(workspace.getViews(), COMPONENT_VIEW));
exportToPlantUml(workspace.getViews().getViewWithKey(JVM2_COMPONENT_VIEW));
exportToPlantUml(findViewWithKey(workspace.getViews(), JVM2_COMPONENT_VIEW));
addStyles(workspace.getViews());
//uploadToExternal(workspace);
}
private static View findViewWithKey(ViewSet viewSet, String key) {
if (key == null) {
throw new IllegalArgumentException("A key must be specified.");
}
Set<View> views = new HashSet<>();
views.addAll(viewSet.getSystemLandscapeViews());
views.addAll(viewSet.getSystemContextViews());
views.addAll(viewSet.getContainerViews());
views.addAll(viewSet.getComponentViews());
views.addAll(viewSet.getDynamicViews());
views.addAll(viewSet.getDeploymentViews());
return views.stream().filter(v -> key.equals(v.getKey())).findFirst().orElse(null);
}
private static void addSpringComponents(Workspace workspace) throws Exception {
Container jvm2 = workspace.getModel().getSoftwareSystemWithName(PAYMENT_TERMINAL).getContainerWithName("JVM-2");