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> <repositories>
<repository> <repository>
<id>spring-snapshots</id> <id>spring-release</id>
<name>Spring Snapshots</name> <name>Spring Release</name>
<url>https://repo.spring.io/release</url> <url>https://repo.spring.io/release</url>
<snapshots> <snapshots>
<enabled>true</enabled> <enabled>false</enabled>
</snapshots> </snapshots>
<releases> <releases>
<enabled>false</enabled> <enabled>true</enabled>
</releases> </releases>
</repository> </repository>
</repositories> </repositories>

View File

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

View File

@ -2,6 +2,8 @@ package com.baeldung.structurizr;
import java.io.File; import java.io.File;
import java.io.StringWriter; import java.io.StringWriter;
import java.util.HashSet;
import java.util.Set;
import com.structurizr.Workspace; import com.structurizr.Workspace;
import com.structurizr.analysis.ComponentFinder; import com.structurizr.analysis.ComponentFinder;
@ -40,16 +42,32 @@ public class StructurizrSimple {
addContainers(workspace); addContainers(workspace);
addComponents(workspace); addComponents(workspace);
addSpringComponents(workspace); addSpringComponents(workspace);
exportToPlantUml(workspace.getViews().getViewWithKey(SOFTWARE_SYSTEM_VIEW)); exportToPlantUml(findViewWithKey(workspace.getViews(), SOFTWARE_SYSTEM_VIEW));
exportToPlantUml(workspace.getViews().getViewWithKey(CONTAINER_VIEW)); exportToPlantUml(findViewWithKey(workspace.getViews(), CONTAINER_VIEW));
exportToPlantUml(workspace.getViews().getViewWithKey(COMPONENT_VIEW)); exportToPlantUml(findViewWithKey(workspace.getViews(), COMPONENT_VIEW));
exportToPlantUml(workspace.getViews().getViewWithKey(JVM2_COMPONENT_VIEW)); exportToPlantUml(findViewWithKey(workspace.getViews(), JVM2_COMPONENT_VIEW));
addStyles(workspace.getViews()); addStyles(workspace.getViews());
//uploadToExternal(workspace); //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 { private static void addSpringComponents(Workspace workspace) throws Exception {
Container jvm2 = workspace.getModel().getSoftwareSystemWithName(PAYMENT_TERMINAL).getContainerWithName("JVM-2"); Container jvm2 = workspace.getModel().getSoftwareSystemWithName(PAYMENT_TERMINAL).getContainerWithName("JVM-2");
findComponents(jvm2); findComponents(jvm2);