Merge pull request #9594 from amit2103/JAVA-2020

updated the snapshot repo to release
This commit is contained in:
Josh Cummings 2020-06-29 08:33:05 -06:00 committed by GitHub
commit b18658922a
3 changed files with 28 additions and 10 deletions

View File

@ -16,14 +16,14 @@
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot</url>
<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");